I have a Weblogic server with Java application that is writing the log messages to a wrong file. Actually the logs (using Log4J) can be found in the error stream (the file /opt/APP/logs/app.err).
I've seen the issue on a weblogic server version 12.2.1.2.0 (but also someolder versions).
In the Server Startup parameters following is provided:
-Dlog4j.configuration=file:/opt/APP/config/app_log4j.properties
-Dweblogic.Stderr=/opt/APP/logs/app.err
-Dweblogic.Stdout=/opt/APP/logs/app.out
In the code a sample line is:
private static final Logger LOG = LoggerFactory.getLogger(AppClassRunning.class);
...
LOG.info("Starting run");
I haven't found any manual configuration in the code that would change the redirecting of the log to the error stream.
In the file '/opt/APP/config/app_log4j.properties':
log4j.rootCategory = INFO,fileA
log4j.appender.fileA = org.apache.log4j.RollingFileAppender
log4j.appender.fileA.file = /opt/APP/logs/app_application_log4j.log
log4j.appender.fileA.layout = org.apache.log4j.PatternLayout
log4j.appender.fileA.Threshold = INFO
log4j.appender.fileA.layout.ConversionPattern = %t %d %-5p | (%c:%L) - %m%n
log4j.appender.fileA.MaxFileSize = 10MB
log4j.appender.fileA.MaxBackupIndex = 5
log4j.category.com.APP = INFO
I also tried to look for other statements in the code that directly write to the error stream - nothing found.
I tried to configure with the properties file to log somewhere else but without effect.
How can I find out (debugging seems not to work) what is the cause for writing to the error stream.