As the problem most people ever meet, the log of my web app is only printed within the log of wildfly. For DailyRollingFileAppender the log file is not existed at specific folder
I have tried some way following instruction online. Here is my configuration.
log4j.properties
log4j.rootLogger=DEBUG,console,R
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.Threshold=DEBUG
log4j.appender.console.ImmediateFlush=true
log4j.appender.console.Target=System.out
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=[%p]\t%d [%t] %c:%m%n
log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
log4j.appender.R.MaxFileSize=10000KB
log4j.appender.R.Threshold=DEBUG
log4j.appender.R.MaxBackupIndex=5
log4j.appender.R.File=/home/wiscom/logs/parking_service.log
#log4j.appender.R.File=${catalina.home}/parking_service.log
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=[%p]\t%d [%t] %c:%m%n
webapp/WEB-INF/jboss-deployment-structure.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<deployment>
<exclusions>
<module name="org.apache.log4j"></module>
</exclusions>
</deployment>
</jboss-deployment-structure>
and in standalone\configuration\standalone.xml , add
standalone\configuration\standalone.xml
under <subsystem xmlns="urn:jboss:domain:logging:3.0">, like this
<profile>
<subsystem xmlns="urn:jboss:domain:logging:3.0">
<use-deployment-logging-config value="false"/>
<console-handler name="CONSOLE">
<level name="INFO"/>
<formatter>
<named-formatter name="COLOR-PATTERN"/>
</formatter>
</console-handler>
...
It was working in Tomcat, but daily rolling log file cannot been seen under specified directory. Can someone help me?