[logback-user] load logback.groovy

林春晓 lin_cx0128 at 163.com
Sun Sep 28 05:03:27 CEST 2014


Loading the file logback.groovy,have a error,follow:
-ERROR in ch.qos.logback.classic.LoggerContext[default] - Groovy classes are not available on the class path. ABORTING INITIALIZATION.
I don't solve the problem ,can you tell me how to solve the problem ,thanks.


my logback.groovy:


import ch.qos.logback.classic.encoder.PatternLayoutEncoder
import ch.qos.logback.core.ConsoleAppender
import ch.qos.logback.core.rolling.RollingFileAppender
import ch.qos.logback.core.rolling.TimeBasedRollingPolicy
import static ch.qos.logback.classic.Level.DEBUG
import static ch.qos.logback.classic.Level.INFO
scan("60 seconds")
def LOG_HOME = "e:\\aqps-log"
def APP_NAME = "aqps"
def GLOBAL-LOG = "globallog"
def moudle1 = "m1"
def moudle2 = "m2"
def moudle3 = "m3"
context.name = "${APP_NAME}"
appender("CONSOLE", ConsoleAppender) {
  encoder(PatternLayoutEncoder) {
    pattern = "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread]%-5level%logger{80}[%L] - %msg%n"
  }
}
appender("g1", RollingFileAppender) {
  rollingPolicy(TimeBasedRollingPolicy) {
    fileNamePattern = "${LOG_HOME}/${APP_NAME}-${GLOBAL-LOG}-%d{yyyy-MM-dd}.log"
    maxHistory = 30
  }
  encoder(PatternLayoutEncoder) {
    pattern = "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{80} - %msg%n"
  }
}
appender("name1", RollingFileAppender) {
  rollingPolicy(TimeBasedRollingPolicy) {
    fileNamePattern = "${LOG_HOME}/${APP_NAME}-%d{yyyy-MM-dd}.log"
    maxHistory = 30
  }
  encoder(PatternLayoutEncoder) {
    pattern = "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{80} - %msg%n"
  }
}
logger("com.nielesnccdata.test", INFO, ["name1"], false)
root(DEBUG, ["CONSOLE", "g1"])



I don't solve the problem ,can you tell me how to solve the problem ,thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20140928/bca14d0c/attachment.html>


More information about the Logback-user mailing list