Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
1.0.1, 1.0.6
-
Ubuntu 10.04 (32bit and 64bit)
Tomcat 6.0.24
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.13) (6b20-1.9.13-0ubuntu1~10.04.1)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)logback.xml:
<configuration scan="true" scanPeriod="30 seconds">
<statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" />
<appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender">
{ISO8601}
<discriminator class="ch.qos.logback.classic.sift.JNDIBasedContextDiscriminator">
<defaultValue>unknown</defaultValue>
</discriminator>
<sift>
<appender name="FILE-${contextName}" class="ch.qos.logback.core.FileAppender">
<file>/var/log/webapps/${contextName}/${contextName}.log</file>
<encoder>
<pattern>%-30(%date[%thread]) %-5level %logger
{32}- %msg%n</pattern>
</encoder>
</appender>
</sift>
</appender><root level="INFO">
<appender-ref ref="SIFT" />
</root></configuration>
The logback and slf4j jars are being stored in a shared lib, as is the logback.xml.
Ubuntu 10.04 (32bit and 64bit) Tomcat 6.0.24 java version "1.6.0_20" OpenJDK Runtime Environment (IcedTea6 1.9.13) (6b20-1.9.13-0ubuntu1~10.04.1) OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode) logback.xml: <configuration scan="true" scanPeriod="30 seconds"> <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" /> <appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender"> <discriminator class="ch.qos.logback.classic.sift.JNDIBasedContextDiscriminator"> <defaultValue>unknown</defaultValue> </discriminator> <sift> <appender name="FILE-${contextName}" class="ch.qos.logback.core.FileAppender"> <file>/var/log/webapps/${contextName}/${contextName}.log</file> <encoder> <pattern>%-30(%date {ISO8601} [%thread] ) %-5level %logger {32} - %msg%n</pattern> </encoder> </appender> </sift> </appender> <root level="INFO"> <appender-ref ref="SIFT" /> </root> </configuration> The logback and slf4j jars are being stored in a shared lib, as is the logback.xml.
Description
When the context is restarted, it stops logging.
We have found that when the Logger is created within the application itself, after stopping and restarting the cotnext it no longer logs. If the loggers are created within a jar that is in the WEB-INF/lib folder, then it continues to log past the context restart.
We have tried 1.0.1 (what we currently use) and we also tested this with 1.0.6, just in case an update had corrected it.
We used the SLF4J 1.6.4 with logback 1.0.1 and SLF4J 1.6.6 with logback 1.0.6, but we experienced the same issues across all tests.
This bug matches the closed (could not reproduce) bug LOGBACK-356 (which was reported against a much older version of logback)
To reproduce:
Create a logger in the web app.
Create a separate logger in a jar in the web apps WEB-INF/lib
have the main logger write a log statement.
have the jar logger write a log statement.
Restart the context
See logging fail in the webapp logger.
See logging continue in the jar logger (e.g. spring).