Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Double logging after customizing module-log4j.xml
Hello.
Im currently adding loggin options for my modules using (https://dev.liferay.com/de/develop/tutorials/-/knowledge_base/7-0/adjusting-module-logging) as guide. I have managed to change pattern for specific java package, but now I have problem that I get double logging to catalina.out Is there any way to disable logging for stock tomcat and instead use my custom module-log4j-ext.xml only?
module-log4j-ext.xml
Thanks for help in advance!
Im currently adding loggin options for my modules using (https://dev.liferay.com/de/develop/tutorials/-/knowledge_base/7-0/adjusting-module-logging) as guide. I have managed to change pattern for specific java package, but now I have problem that I get double logging to catalina.out Is there any way to disable logging for stock tomcat and instead use my custom module-log4j-ext.xml only?
module-log4j-ext.xml
<!--?xml version="1.0"?-->
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss.SSS} %-5p [%t] [%C] %m%n">
</layout>
</appender>
<category name="foo.bar">
<priority value="DEBUG" />
<appender-ref ref="console" />
</category>
</log4j:configuration>catalina.out after previous modification23.10.2018 08:15:27.519 WARN [http-nio-8081-exec-3] [foo.bar.testClass] testLogging <-- Overridden logging
2018-10-23 08:15:27.519 WARN [http-nio-8081-exec-3][testClass] testLogging <-- originaltomcat logging (Needs to be removed)Thanks for help in advance!
Jani Oksanen<category name="foo.bar"> <priority value="DEBUG" /> <appender-ref ref="console" /> </category>
Have you already tried setting the additivity to false?
<category name="foo.bar" additivity="false">
<priority value="DEBUG" />
<appender-ref ref="console" />
</category>