log4j is not able to update the log file of wildfly 18 server application

687 Views Asked by At

I recently moved my application from java 1.6 to 1.8 and also changed its server from jboss eap 6 to wildfly 18. Server up and running , application is running but logs are not updating in the file.

Below is my log4j.xml - which i haven't changed at all -

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
    <appender name="stdout" class="org.apache.log4j.ConsoleAppender">
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%5p [%d] (%F:%L) - %m%n" />
        </layout>
    </appender>
    <appender name="AgentMailLog4jRollingFileAppender"
        class="org.apache.log4j.RollingFileAppender">
        <param name="File" value="/appshr/jb6-logs/agentmailClusterC/log/AgentMail.log" />
        <!-- <param name="File" value="../server/default/log/AgentMail.log" /> -->
        <!-- <param name="File" value="../logs/log/AgentMail.log" /> -->
        <param name="MaxFileSize" value="500KB" />
        <param name="MaxBackupIndex" value="10" />
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%5p [%d] (%F:%L) - %m%n" />
        </layout>
    </appender>
    
    <category name="com.cablevision" additivity="false">
        <priority value="debug" />
        <appender-ref ref="stdout" />
        <appender-ref ref="AgentMailLog4jRollingFileAppender" />
    </category>
    
    <root>
        <priority value="error" />
        <appender-ref ref="stdout" />
        <appender-ref ref="AgentMailLog4jRollingFileAppender" /> 
    </root>
</log4j:configuration>

What can be the reason that its not updating the file?

I tried to delete the file and rerun the application but new file didn't generated, why so? What I am missing in log4j or in wildfly?

0

There are 0 best solutions below