Hi all,

I am in the process of migrating an application from Log4J 1.2.16 to Log4J 
2.13.3. I am using the log4j 1.2 to 2.13.3 bridge for this purpose. 

I am almost done and on my own development machine everything is working 
perfectly. However, when I deploy the application to a test server all the 
logging gets send to the root logger only. The log4j2.xml configuration files 
on both machines are exactly the same, only the paths differ. Also: my 
development machine runs Windows, the test server runs Linux. I have added the 
one on the test server to the end of this e-mail, excuse the messy replace 
statement. Some extra information: the application runs on Weblogic 12.2.1.3.

On my own machine I added the location of the log4j2.xml to the classpath. On 
the test server I have tried adding the location to the classpath as well as 
setting it through the log4j.configurationFile Java VM parameter. The result in 
both cases is the same: all the logfiles are created at startup but only the 
one mentioned in the root logger gets logdata send to it, the other logfiles 
stay empty. This tells me that at least Log4J2 is able to find and read the 
configuration file. I have tried switching the appender which is mentioned in 
the root logger. In that case logging data gets send to that file, so it does 
not seem to be anything filesystem related.

I am completely lost here and do not know what is going wrong, hence this 
e-mail. Any ideas?

Kind regards,

Michiel

<?xml version="1.0" encoding="UTF-8" ?>
<Configuration monitorInterval="60">
        <Appenders>
                <RollingFile name="ERROR_LOG" 
fileName="/var/log/weblogic/app/error.log" 
filePattern="/var/log/weblogic/app/error.log%d{yyyy-MM-dd}.gz">
                        <PatternLayout charset="UTF-8" 
pattern="###%d{yyyy-MM-dd HH:mm:ss,SSS Z}{Europe/Amsterdam}|%d{yyyy-MM-dd 
HH:mm:ss,SSS 
Z}{UTC}|%-5p|%t|%c{2}|%replace{%replace{%replace{%m}{(&lt;[^/]*?[wW]achtwoord.*?&gt;).*?(&lt;/.*?[wWWachtwoord].*?&gt;)}{$1********$2}}{(&lt;pw&gt;).*?(&lt;/pw&gt;)}{$1********$2}}{(&lt;newPW&gt;).*?(&lt;/newPW&gt;)}{$1********$2}|%n"
 />
                        <Policies>
                                <TimeBasedTriggeringPolicy interval="1"/>
                        </Policies>
                        <DefaultRolloverStrategy max="7"/>
                </RollingFile>
                <RollingFile name="DEBUG_LOG" 
fileName="/var/log/weblogic/app/debug.log" 
filePattern="/var/log/weblogic/app/debug.log%d{yyyy-MM-dd}.gz">
                        <PatternLayout charset="UTF-8" 
pattern="###%d{yyyy-MM-dd HH:mm:ss,SSS Z}{Europe/Amsterdam}|%d{yyyy-MM-dd 
HH:mm:ss,SSS 
Z}{UTC}|%-5p|%t|%c{2}|%replace{%replace{%replace{%m}{(&lt;[^/]*?[wW]achtwoord.*?&gt;).*?(&lt;/.*?[wWWachtwoord].*?&gt;)}{$1********$2}}{(&lt;pw&gt;).*?(&lt;/pw&gt;)}{$1********$2}}{(&lt;newPW&gt;).*?(&lt;/newPW&gt;)}{$1********$2}|%n"
 />
                        <Policies>
                                <TimeBasedTriggeringPolicy interval="1"/>
                        </Policies>
                        <DefaultRolloverStrategy max="7"/>
                </RollingFile>
                <RollingFile name="FACADE_LOG" 
fileName="/var/log/weblogic/app/facade.log" 
filePattern="/var/log/weblogic/app/facade.log%d{yyyy-MM-dd}.gz">
                        <PatternLayout charset="UTF-8" 
pattern="###%d{yyyy-MM-dd HH:mm:ss,SSS Z}{Europe/Amsterdam}|%d{yyyy-MM-dd 
HH:mm:ss,SSS 
Z}{UTC}|%-5p|%t|%c{2}|%replace{%replace{%replace{%m}{(&lt;[^/]*?[wW]achtwoord.*?&gt;).*?(&lt;/.*?[wWWachtwoord].*?&gt;)}{$1********$2}}{(&lt;pw&gt;).*?(&lt;/pw&gt;)}{$1********$2}}{(&lt;newPW&gt;).*?(&lt;/newPW&gt;)}{$1********$2}|%n"
 />
                        <Policies>
                                <TimeBasedTriggeringPolicy interval="1"/>
                        </Policies>
                        <DefaultRolloverStrategy max="7"/>
                </RollingFile>
                <RollingFile name="AUDIT_LOG" 
fileName="/var/log/weblogic/audit/audit.log" 
filePattern="/var/log/weblogic/audit/audit.log%d{yyyy-MM-dd}.gz">
                        <PatternLayout charset="UTF-8" 
pattern="###%d{yyyy-MM-dd HH:mm:ss,SSS Z}{Europe/Amsterdam}|%d{yyyy-MM-dd 
HH:mm:ss,SSS 
Z}{UTC}|%-5p|%t|%c{2}|%replace{%replace{%replace{%m}{(&lt;[^/]*?[wW]achtwoord.*?&gt;).*?(&lt;/.*?[wWWachtwoord].*?&gt;)}{$1********$2}}{(&lt;pw&gt;).*?(&lt;/pw&gt;)}{$1********$2}}{(&lt;newPW&gt;).*?(&lt;/newPW&gt;)}{$1********$2}|%n"
 />
                        <Policies>
                                <TimeBasedTriggeringPolicy interval="1"/>
                        </Policies>
                        <DefaultRolloverStrategy max="7"/>
                </RollingFile>
        </Appenders>
        <Loggers>
                <Logger name="nl.sidn.app.facade" level="debug" 
additivity="false">
                        <AppenderRef ref="FACADE_LOG"/>
                </Logger>
                <Logger name="nl.sidn.app.auditadapter" level="debug" 
additivity="false">
                        <AppenderRef ref="AUDIT_LOG"/>
                </Logger>
                <Logger name="nl.sidn.app.proces" level="debug" 
additivity="false">
                        <AppenderRef ref="DEBUG_LOG"/>
                </Logger>
                <Root level="debug">
                        <AppenderRef ref="ERROR_LOG" />
                </Root>
        </Loggers>
</Configuration>


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org

Reply via email to