I am using logback version 1.0.11 with the following configuration. The log
file is created but it is empty. That is, no log messages are put into it?
What is wrong with my configuration?

appender("close-period", GSiftingAppender) {
discriminator(MDCBasedDiscriminator) {
key = "period"
defaultValue = "unknown"
}
//timeout = "1 minutes"
sift {
appender("close-${period}", FileAppender) {
file = "${logDir}/close-${period}.log"
append = false
layout(PatternLayout) {
pattern = "%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n"
}
}
}
}
logger("mlm.close_period", INFO, ["close-period"], false)


the test code is

@Test
def testClosePeriod {
import org.slf4j.MDC
val logger = LoggerFactory.getLogger("mlm.close_period")
MDC.put("period", "2014-02")
logger.info("testClosePeriod is run")
MDC.remove("period")
}
_______________________________________________
Logback-user mailing list
[email protected]
http://mailman.qos.ch/mailman/listinfo/logback-user

Reply via email to