[logback-dev] [JIRA] (LOGBACK-1252) logback xml useless when LogbackValve is use in tomcat

QOS.CH (JIRA) noreply-jira at qos.ch
Mon Feb 6 08:02:00 CET 2017


finalmachine created LOGBACK-1252:
-------------------------------------

             Summary: logback xml useless when LogbackValve is use in tomcat
                 Key: LOGBACK-1252
                 URL: https://jira.qos.ch/browse/LOGBACK-1252
             Project: logback
          Issue Type: Bug
          Components: logback-access
    Affects Versions: 1.1.9
         Environment: Windows 7 x64
Tomcat 8.5.7 x64
Java 8
            Reporter: finalmachine
            Assignee: Logback dev list


when you put
logback-access-1.1.9.jar
logback-classic-1.1.9.jar
logback-core-1.1.9.jar
slf4j-api-1.7.22.jar
into the tomcat /lib

then
in the server.xml use
<Valve className="ch.qos.logback.access.tomcat.LogbackValve" />

add logback-access.xml in the /conf

ok the LogbackValve is useful but the webapp who use logback which has it's own logback.xml will be useless.
in the logback.xml if you set
	<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
		<encoder>
			<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %n%msg%n</pattern>
		</encoder>
	</appender>

	<root level="info">
		<appender-ref ref="STDOUT"/>
	</root>

	<logger name="org.springframework" level="warn" additivity="false">
		<appender-ref ref="STDOUT"/>
	</logger>

	<logger name="org.mongodb.driver" level="warn" additivity="false">
		<appender-ref ref="STDOUT"/>
	</logger>
the level="warn" is useless, the spring and mongodb log with the debug level will be see.

maybe you will tell me to put logback.xml in the tomcat /lib directry. but I will say no. every webapp can has it's own log logic and be independent of each other is what the Java EE hoped.
so I think this is a bug of logback not a Improvement.



--
This message was sent by Atlassian JIRA
(v6.4.12#64027)


More information about the logback-dev mailing list