Is it possible to confgure log messages from ch.qos.logback using logback.xml? - logback

I am successfully using logback for an application, but have been unable to log messages from ch.qos.logback. I am aware that one is unable to log the initial messages (answers below confirm this) and that makes sense. What I don't understand is why I haven't been able to log the messages generated after logback has finished configuring itself.
So, there is no way to tell Logback to direct its own on-startup-log-events to a file appender.
"The first log output by ch.qos.logback can't be redirected using the log configuration because this output happens while Logback reads it's configuration -> hen / egg style problem."
The logback.xml (this exact code will generate ERROR messages from ch.qos.logback.classic.net.SMTPAppender when it fails to login to the email server):
<?xml version="1.0" encoding="UTF-8"?>
<!-- see http://logback.qos.ch/manual/configuration.html -->
<configuration scan="true" debug="true">
<timestamp key="bySecond" datePattern="yyyyMMdd'T'HHmmss"/>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg~%n</Pattern>
</encoder>
</appender>
<appender name="testFile" class="ch.qos.logback.core.FileAppender">
<file> testFile.txt </file>
<append>false</append>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg~%n</Pattern>
</encoder>
</appender>
<appender name="GMAIL_EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
<smtpHost>smtp.gmail.com</smtpHost>
<smtpPort>587</smtpPort>
<asynchronousSending>true</asynchronousSending>
<username>xxx</username>
<password>xxx</password>
<STARTTLS>true</STARTTLS>
<to>xxx</to>
<from>xxx</from>
<subject>Error: %logger{20} - %m</subject>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{HH:mm:ss} [%thread] %-5level %logger{36} - %msg~%n</Pattern>
</layout>
</appender>
<root level="INFO">
<appender-ref ref="STDOUT" />
<appender-ref ref="testFile" />
<appender-ref ref="GMAIL_EMAIL" />
</root>
<logger name="ch.qos.logback" level="DEBUG" >
</logger>
</configuration>
debug console output:
13:05:07,626 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [conf\logback.xml] at [file:/C:/OleAppnWorkArea/staging__unity_group14b/conf/logback.xml]
13:05:07,806 |-INFO in ReconfigureOnChangeFilter{invocationCounter=0} - Will scan for changes in [[C:\OleAppnWorkArea\staging__unity_group14b\conf\logback.xml]] every 60 seconds.
13:05:07,806 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Adding ReconfigureOnChangeFilter as a turbo filter
13:05:07,806 |-INFO in ch.qos.logback.core.joran.action.TimestampAction - Using current interpretation time, i.e. now, as time reference.
13:05:07,816 |-INFO in ch.qos.logback.core.joran.action.TimestampAction - Adding property to the context with key="bySecond" and value="20181109T130507" to the LOCAL scope
13:05:07,816 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
13:05:07,816 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
13:05:07,882 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
13:05:07,887 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [testFile]
13:05:07,897 |-INFO in ch.qos.logback.core.FileAppender[testFile] - File property is set to [testFile.txt]
13:05:07,899 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.net.SMTPAppender]
13:05:07,910 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [GMAIL_EMAIL]
13:05:07,950 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
13:05:07,950 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
13:05:07,951 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [testFile] to Logger[ROOT]
13:05:07,951 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [GMAIL_EMAIL] to Logger[ROOT]
13:05:07,952 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [ch.qos.logback] to DEBUG
13:05:07,952 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
13:05:07,953 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator#481a996b - Registering current configuration as safe fallback point
13:05:07.966 [main] ERROR xxx - error to use for debugging logging~
13:05:07,972 |-INFO in ch.qos.logback.classic.net.SMTPAppender[GMAIL_EMAIL] - SMTPAppender [GMAIL_EMAIL] is tracking [1] buffers
13:05:07,997 |-INFO in ch.qos.logback.classic.net.SMTPAppender[GMAIL_EMAIL] - About to send out SMTP message "Error: xxx - error to use for debugging logging" to [xxx]
13:05:09,019 |-ERROR in ch.qos.logback.classic.net.SMTPAppender[GMAIL_EMAIL] - Error occurred while sending e-mail notification. javax.mail.AuthenticationFailedException: 535-5.7.8 Username and Password not accepted. Learn more at
535 5.7.8 https://support.google.com/mail/?p=BadCredentials o27-v6sm5469472wro.24 - gsmtp at javax.mail.AuthenticationFailedException: 535-5.7.8 Username and Password not accepted. Learn more at
535 5.7.8 https://support.google.com/mail/?p=BadCredentials o27-v6sm5469472wro.24 - gsmtp
at at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:965)
at at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:876)
at at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:780)
at at javax.mail.Service.connect(Service.java:388)
at at javax.mail.Service.connect(Service.java:246)
at at javax.mail.Service.connect(Service.java:195)
at at javax.mail.Transport.send0(Transport.java:254)
at at javax.mail.Transport.send(Transport.java:124)
at at ch.qos.logback.core.net.SMTPAppenderBase.sendBuffer(SMTPAppenderBase.java:394)
at at ch.qos.logback.core.net.SMTPAppenderBase$SenderRunnable.run(SMTPAppenderBase.java:677)
at at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at at java.lang.Thread.run(Thread.java:748)
testFile.txt only contains:
13:05:07.966 [main] ERROR xxx- error to use for debugging logging~
The messages generated by ch.qos.logback.classic.net.SMTPAppender follow the same pattern as the startup messages and not the pattern I defined in appender STDOUT, suggesting that they are not even using my STDOUT appender. Additionally they are not even appearing in the testFile appender output.
Can anyone shed any light on this, please? I have read the docs and done this testing and am left with no further avenues.

Logback does not use loggers to report its own log output. Logback's own logs are called "status messages". See documentation on status printing and status listeners

Related

slf4j, logback, the target compressed file named exist already

logback 1.1.5 + slf4j 1.7.4.
Rollover at midnight
00:00:00,163 |-INFO in c.q.l.co.rolling.helper.RenameUtil - Renaming file [/opt/wls/appl/log/out.log] to [/opt/wls/appl/log/out.log1294410077875834.tmp]
00:00:00,164 |-INFO in ch.qos.logback.core.rolling.helper.Compressor - ZIP compressing [/opt/wls/appl/log/out.log1294410077875834.tmp] as [/opt/wls/appl/log/archive/out/out-2018-09-04.10.zip]
But after some seconds rollover starts again
00:01:52,551 |-INFO in c.q.l.co.rolling.helper.RenameUtil - Renaming file [/opt/wls/appl/log/out.log] to [/opt/wls/appl/log/out.log1294522459498363.tmp]
00:01:52,551 |-WARN in ch.qos.logback.core.rolling.helper.Compressor - The target compressed file named [/opt/wls/appl/log/archive/out/out-2018-09-04.0.zip] exist already.
There are 2 applications on 2 virtual servers of WLS. Both of applications use separate home folder with your own logback.xml.
logback.xml is
<appender name="ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${PRG_HOME}/logs/out/out-%d{yyyy-MM-dd}.%i.zip</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>%d{dd/MM/yyyy HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n%ex</pattern>
</encoder>
</appender>
<appender name="ASYNC_COMMON" class="ch.qos.logback.classic.AsyncAppender">
<queueSize>32000</queueSize>
<appender-ref ref="ROLLING" />
</appender>
What can I do?
You can try to add <prudent>true</prudent> to your RollingFileAppender. This should allow for multiple JVMs writing safely to the same file.
There are some restrictions that apply to prudent mode, though. Log-file compression is not allowed, for example.

Logback configuration with external file, log file is empty

I try configure logging via external file. WLS 10.3.6, startWebLogic.properties include:
-Dproject_name_home=D:\path\to\project_home ^
-Dlogging.config=${project_name_home}/conf/logback.xml ^
-Dlogging.path=${project_name_home}/log ^
-Dlogging.file=${project_name_home}/log/out.log ^
-Dorg.apache.cxf.Logger=org.apache.cxf.common.logging.Slf4jLogger
out.log was created in project home folder, but it is empty.
according to log logback.xml used inside application, not from external file:
19:05:27,621 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
19:05:27,622 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
19:05:27,622 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [zip:D:/Weblogic10.3.6/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/project_name/pjckx7/war/WEB-INF/lib/_wl_cls_gen.jar!/logback.xml]
What's wrong? Please help to configure logging with external file.
My external logback.xml is:
<configuration>
<property name="LOG_PATH" value="${project_home}/log" />
<property name="LOG_FILE" value="${LOG_PATH}/out.log" />
<appender name="ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_FILE}</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_PATH}/archive/out/out-%d{yyyy-MM-dd}.%i.zip</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>%d{dd/MM/yyyy HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n%ex</pattern>
</encoder>
</appender>
<logger name="package.name" level="debug">
<appender-ref ref="ROLLING" />
</logger>
</configuration>
Logging configure inside application, application.yml is:
logging:
level:
package:
name: DEBUG
path: ${project_home}/logs
pattern:
console: "${CONSOLE_LOG_PATTERN:%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %maskedM%n${LOG_EXCEPTION_CONVERSION_WORD:%wEx}}"
file: "${FILE_LOG_PATTERN:%d{yyyy-MM-dd HH:mm:ss.SSS} ${LOG_LEVEL_PATTERN:%5p} ${PID:- } --- [%t] %-40.40logger{39} : %maskedM%n${LOG_EXCEPTION_CONVERSION_WORD:%wEx}}"
So, the next steps for logging configuration via external logback.xml are:
set logging.config (path to external logback.xml) in WLS start file.
also logging levels defined in application.yml need configure in WLS start file (logging.level. parameter, according to question need set logging.level.package.name parameter).
levels for another packages (not defined in application.yml) are configure in logback.xml.
other parameters (logging.path, logging.file) should be deleted.
all other parameters are configure at external logback.xml as before.

suppressing info messages from logback

application i work will be created as jar file and run it through command line. there is no application servers involved.
when i run the jar file below info from logback is printed on console. how do i suppress all logging from logback packages
13:46:30,534 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
13:46:30,534 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
13:46:30,534 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/Users/util/target/classes/logback.xml]
13:46:30,588 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
13:46:35,598 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
13:46:35,605 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [stdout]
13:46:35,621 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
13:46:35,629 |-WARN in ch.qos.logback.classic.encoder.PatternLayoutEncoder#326de728 - [outputPatternAsPresentationHeader] property is deprecated. Please use [outputPatternAsHeader] option instead.
13:46:35,661 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting additivity of logger [org.springframework] to false
13:46:35,661 |-INFO in ch.qos.logback.classic.joran.action.LevelAction - org.springframework level set to ERROR
13:46:35,661 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [stdout] to Logger[org.springframework]
13:46:35,661 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [ch.qos.logback] to OFF
13:46:35,661 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting additivity of logger [ch.qos.logback] to false
13:46:35,665 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter#24:27 - no applicable action for [priority], current ElementPath is [[configuration][root][priority]]
13:46:35,666 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [stdout] to Logger[ROOT]
13:46:35,666 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
13:46:35,666 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator#25618e91 - Registering current configuration as safe fallback point
logback.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender" >
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="org.springframework" additivity="false">
<level value="error"/>
<appender-ref ref="stdout"/>
</logger>
<logger name="ch.qos.logback" level="OFF" additivity="false" />
<root>
<priority value="warn"/>
<appender-ref ref="stdout"/>
</root>
</configuration>
tried all options as well as discussion at thread Suppress all Logback output to console?.
nothing helped me, any pointers would be helpful. i am on logback version 1.0.13 and slf4j 1.7.5
First, the right way.
Fix the WARN/ERROR problems.
Here's the relevant logback docs. The status messages collected during logback initialization are printed to console if there are any ERROR or WARN level problems during init. So a good way to get rid of the console output is to fix the ERROR and WARN messages you are getting.
You can have a look at the source code of StaticLoggerBinder.
if(!StatusUtil.contextHasStatusListener(defaultLoggerContext)) {
StatusPrinter.printInCaseOfErrorsOrWarnings(defaultLoggerContext);
}
It is not going through your registered logger because these are status messages generated before logback is initialised. It's a catch-22, you would need a properly configured logback context to log error messages about how it failed to start.
You can change what is done with these console messages but it might be your only insight into why logging isn't working.
One thing to fix in your config is to change the root to
<root level="WARN">
<appender-ref ref="stdout"/>
</root>
There is an error message telling you that priority is not a valid element
13:46:35,665 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter#24:27 - no applicable action for [priority], current ElementPath is [[configuration][root][priority]]
Modify or suppress status message logging
Set a statusListener in your logback.xml
<configuration>
<statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" />
</configuration>
The options provided by logback are:
NopStatusListener : do nothing
OnConsoleStatusListener : log all status messages to stdout
OnErrorConsoleStatusListener : log all status messages to stderr
StatusListenerAsList : collect statuses in a list for you to access later

scanPeriod attribute is required by logback-classic for auto-reload to work

Is this a bug in logback classic or am I missing something? The documentation is pretty explicit about scanPeriod being an optional attribute:
By default, the configuration file will be scanned for changes once
every minute.
However, given a logback.xml file like below:
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="true" scan="true" >
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5p %c{1}:%L - %m%n</pattern>
<charset>utf8</charset>
</encoder>
</appender>
<root level="WARN">
<appender-ref ref="CONSOLE" />
</root>
</configuration>
I get the following output from logback and scan does not work.
16:40:56,244 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
16:40:56,244 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
16:40:56,244 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/home/jbochenski/acme/acme-func-test/conf/logback.xml]
16:40:56,323 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
16:40:56,325 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [CONSOLE]
16:40:56,331 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:40:56,354 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to WARN
16:40:56,355 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [CONSOLE] to Logger[ROOT]
16:40:56,355 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
16:40:56,356 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator#146ba0ac - Registering current configuration as safe fallback point
However if I just change the configuration to add scanPeriod attribute <configuration debug="true" scan="true" scanPeriod="1 minute"> it starts working:
16:43:44,584 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
16:43:44,585 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
16:43:44,585 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/home/jbochenski/acme/acme-func-test/conf/logback.xml]
16:43:44,686 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Will scan for changes in [file:/home/jbochenski/acme/acme-func-test/conf/logback.xml]
16:43:44,686 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Setting ReconfigureOnChangeTask scanning period to 1 minutes
16:43:44,688 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
16:43:44,691 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [CONSOLE]
16:43:44,700 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:43:44,727 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to WARN
16:43:44,727 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [CONSOLE] to Logger[ROOT]
16:43:44,727 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
16:43:44,728 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator#f6c48ac - Registering current configuration as safe fallback point
Using:
logback-classic: 1.1.7
slf4j: 1.7.13
UPDATE: See LOGBACK-1194
This indeed looks like a logback bug, and I recommend filing an issue in JIRA.
In 1.1.7, some refactoring was done that affects how the scanPeriod is handled. The changes included abandoning the scan option altogether when no scanPeriod is specified. I don't think that was intentional.

Suppressing Logback output, again

How do I suppress all of Logback's initial output? This question has been asked twice before, but my situation is a little different; Logback isn't throwing any warnings or errors.
Here's the entire log:
17:29:32,471 |-INFO in ch.qos.logback.access.joran.action.ConfigurationAction - Ignoring debug attribute.
17:29:32,472 |-INFO in ch.qos.logback.core.joran.action.StatusListenerAction - Adding status listener of type [ch.qos.logback.core.status.OnConsoleStatusListener]
17:29:32,473 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
17:29:32,473 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
17:29:32,474 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - No compression will be used
17:29:32,474 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the pattern C:/dev/diesel/trunk/diesel-test//logs/request/request-%d{yyyy-MM-dd}.log for the active file
17:29:32,475 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - The date pattern is 'yyyy-MM-dd' from file name pattern 'C:/dev/diesel/trunk/diesel-test//logs/request/request-%d{yyyy-MM-dd}.log'.
17:29:32,475 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Roll-over at midnight.
17:29:32,475 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Setting initial period to Wed Jun 13 17:29:32 CDT 2012
17:29:32,475 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.access.PatternLayoutEncoder] for [encoder] property
17:29:32,497 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Active log file name: C:/dev/diesel/trunk/diesel-test//logs/request/request-2012-06-13.log
17:29:32,497 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - File property is set to [null]
17:29:32,498 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to ch.qos.logback.access.jetty.v7.RequestLogImpl#3caa4b
17:29:32,498 |-INFO in ch.qos.logback.access.joran.action.ConfigurationAction - End of configuration.
17:29:32,499 |-INFO in ch.qos.logback.access.jetty.v7.RequestLogImpl#3caa4b - RequestLog added to RequestLogRegistry with name: LogbackRequestLog
And here's logback.xml. Note that I set root level=OFF for testing.
<configuration>
<property name="MAIN_LOG_DIR" value="${app.home}/logs"/>
<property name="DEFAULT_ENCODER_PATTERN" value="%date{yyyy-MM-dd HH:mm:ss} %logger %-4relative %-5level %msg%n" />
<property name="DEFAULT_FILENAME_PATTERN" value="-%d{yyyy-MM-dd}.log" />
<logger name="org.quartz" additivity="false">
<appender class="ch.qos.logback.core.helpers.NOPAppender"></appender>
</logger>
<root level="OFF">
<appender class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${MAIN_LOG_DIR}/root/root${DEFAULT_FILENAME_PATTERN}</fileNamePattern>
</rollingPolicy>
<encoder><pattern>${DEFAULT_ENCODER_PATTERN}</pattern></encoder>
</appender>
</root>
</configuration>
I also have a separate logback-access.xml, which I'll post if someone wants to see it.
The status messages you see are output by logback-access not logback-classic.
The first line is the give away (there are other indications as well)
|-INFO in ch.qos.logback.**access**.joran.action.ConfigurationAction - Ignoring debug attribute.
Logback-access outputs its internal status on the console because apparently it has been asked to do so:
|-INFO in ch.qos.logback.core.joran.action.StatusListenerAction - Adding status listener of type [ch.qos.logback.core.status.OnConsoleStatusListener]
For logback-access, the configuration file is named logback-access.xml. You should post the contents of that file, not logback.xml.