问题
I am trying to get my web application deployed on Websphere 6.1 to display debug level logs.
Originally I was using log4j, but have changed all loggers to use commons logging since it seems this is supported by Websphere.
I have set the log level under Logging and Tracing > server1 > Change Log Detail Levels to:
*=info: com.myapplication.*=all
Unfortunately this only seems to display info level logs from my application in the SystemOut.log
The following shows up in the logs:
if (log.isInfoEnabled())
log.info("End( messages[" + listMessages.size() + "] )");
But the following (from the same method) does not:
if (log.isDebugEnabled())
log.debug("Start()");
I have not added any log config files to my war as I read that this was set up by Websphere.
Does anyone know how to get logging working correctly in Websphere?
回答1:
To answer my own question, after looking around for an hour, it appears that debug and lower from commons logging are placed into the trace.log file.
Info logs are placed into the SystemOut.log file.
I was expecting debug to go to the SystemOut.log file as well, this is what was causing the confusion.
回答2:
It looks like in WAS 6.1 finest
is equivalent to debug
, so I could set it like so:
*=finest: com.myapplication.*=all
来源:https://stackoverflow.com/questions/3310604/websphere-application-debug-logging