Fixing logback config file locate

This commit is contained in:
Viktor Klang 2010-08-16 12:48:15 +02:00
parent 871e0799f0
commit 90ee6cb425
5 changed files with 68 additions and 15 deletions

View file

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- For assistance related to logback-translator or configuration -->
<!-- files in general, please contact the logback user mailing list -->
<!-- at http://www.qos.ch/mailman/listinfo/logback-user -->
<!-- -->
<!-- For professional support please see -->
<!-- http://www.qos.ch/shop/products/professionalSupport -->
<!-- -->
<!-- FOR AKKA INTERNAL USE ONLY -->
<configuration>
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%4p] [%d{ISO8601}] [%t] %c{1}: %m%n</pattern>
</encoder>
</appender>
<appender name="R" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>./logs/akka.log</File>
<encoder>
<pattern>[%4p] [%d{ISO8601}] [%t] %c{1}: %m%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>./logs/akka.log.%d{yyyy-MM-dd-HH}</fileNamePattern>
</rollingPolicy>
</appender>
<logger name="se.scalablesolutions" level="DEBUG"/>
<root level="INFO">
<appender-ref ref="stdout"/>
<appender-ref ref="R"/>
</root>
</configuration>

View file

@ -141,6 +141,17 @@ class Logger(val logger: SLFLogger) {
*
*/
object Logger {
/* Uncomment to be able to debug what logging configuration will be used
{
import org.slf4j.LoggerFactory
import ch.qos.logback.classic.LoggerContext
import ch.qos.logback.core.util.StatusPrinter
// print logback's internal status
StatusPrinter.print(LoggerFactory.getILoggerFactory.asInstanceOf[LoggerContext])
}*/
def apply(logger: String) : Logger = new Logger(SLFLoggerFactory getLogger logger)
def apply(clazz: Class[_]) : Logger = apply(clazz.getName)
def root : Logger = apply(SLFLogger.ROOT_LOGGER_NAME)

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- For assistance related to logback-translator or configuration -->
<!-- files in general, please contact the logback user mailing list -->
<!-- at http://www.qos.ch/mailman/listinfo/logback-user -->
<!-- -->
<!-- For professional support please see -->
<!-- http://www.qos.ch/shop/products/professionalSupport -->
<!-- -->
<configuration>
<!-- FOR AKKA INTERNAL USE ONLY -->
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%4p] [%d{ISO8601}] [%t] %c{1}: %m%n</pattern>
</encoder>
</appender>
<logger name="se.scalablesolutions" level="DEBUG"/>
<root level="DEBUG">
<appender-ref ref="stdout"/>
</root>
</configuration>

View file

@ -8,20 +8,15 @@
<!-- http://www.qos.ch/shop/products/professionalSupport -->
<!-- -->
<configuration>
<!-- Errors were reported during translation. -->
<!-- Could not find transformer for org.apache.log4j.SimpleLayout -->
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%4p] [%d{ISO8601}] [%t] %c{1}: %m%n</pattern>
<pattern>[%t] [%4p] [%d{ISO8601}] %c{1}: %m%n</pattern>
</encoder>
</appender>
<appender name="R" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!--See http://logback.qos.ch/manual/appenders.html#RollingFileAppender-->
<!--and http://logback.qos.ch/manual/appenders.html#TimeBasedRollingPolicy-->
<!--for further documentation-->
<File>./logs/akka.log</File>
<encoder>
<pattern>[%4p] [%d{ISO8601}] [%t] %c{1}: %m%n</pattern>
<pattern>[%t] [%4p] [%d{ISO8601}] %c{1}: %m%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>./logs/akka.log.%d{yyyy-MM-dd-HH}</fileNamePattern>

View file

@ -128,8 +128,6 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
lazy val commons_io = "commons-io" % "commons-io" % "1.4" % "compile"
lazy val commons_logging = "commons-logging" % "commons-logging" % "1.1.1" % "compile"
lazy val commons_pool = "commons-pool" % "commons-pool" % "1.5.4" % "compile"
lazy val configgy = "net.lag" % "configgy" % "2.8.0-1.5.5" % "compile"
@ -167,8 +165,6 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
lazy val lift_util = "net.liftweb" % "lift-util_2.8.0" % LIFT_VERSION % "compile"
lazy val lift_webkit = "net.liftweb" % "lift-webkit_2.8.0" % LIFT_VERSION % "compile"
lazy val log4j = "log4j" % "log4j" % "1.2.15" % "compile"
lazy val mongo = "org.mongodb" % "mongo-java-driver" % "2.0" % "compile"
lazy val multiverse = "org.multiverse" % "multiverse-alpha" % MULTIVERSE_VERSION % "compile" intransitive
@ -277,9 +273,9 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
override def mainResources = super.mainResources +++
descendents(info.projectPath / "config", "*") ---
(info.projectPath / "config" / "logback-test.xml")
(super.mainResources ** "logback-test.xml")
override def testResources = super.testResources +++ (info.projectPath / "config" / "logback-test.xml")
override def testResources = super.testResources --- (super.testResources ** "logback-test.xml")
// ------------------------------------------------------------
// publishing
@ -394,7 +390,6 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
val atmo_runtime = Dependencies.atmo_runtime
val atmo_tomcat = Dependencies.atmo_tomcat
val atmo_weblogic = Dependencies.atmo_weblogic
val commons_logging = Dependencies.commons_logging
val grizzly = Dependencies.grizzly
val jackson_core_asl = Dependencies.jackson_core_asl
val jersey = Dependencies.jersey
@ -627,7 +622,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
class AkkaSamplePubSubProject(info: ProjectInfo) extends AkkaDefaultProject(info, deployPath) with CodeFellowPlugin
class AkkaSampleLiftProject(info: ProjectInfo) extends DefaultWebProject(info) with DeployProject with CodeFellowPlugin {
val commons_logging = Dependencies.commons_logging
//val commons_logging = Dependencies.commons_logging
val lift_util = Dependencies.lift_util
val lift_webkit = Dependencies.lift_webkit
val servlet = Dependencies.servlet