简体   繁体   中英

No log statement is printing using websphere 8.0

I have one application running in WAS8.

  1. we have a jar - commons-logging-1.1.1.jar in WEB-INF/lib

  2. we have one properties file - commons-logging.properties the content of the file is priority=1 org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl

  3. we have org.apache.commons.logging.LogFactory file in WebContent/META-INF/services the content of the file is org.apache.commons.logging.impl.Log4jFactory The log files are created but nothing is written in it. It is not showing any error in the log files in log of appserver. Please let me know if I am missing something. Please note: if I keep commons-logging.properties in /opt/IBM/WebSphere/80/AppServer/profiles/AppSrv01/properties, then it works perfectly fine. It is writing in the log files. But as I heard it is not standard practice so I can't keep the file in that place. I have to find some alternative way.

    Please help me.

If it is not a requirement to have separate log files for your web application, you can simply remove the commons-log jar and properties from your module (war) and your log statements will write to SystemOut.log according to the log level settings in the WebSphere console (which can be changed at runtime, by the way).

If you must separate application logging, you can refer to this infocenter article that lays out the combination of commons-log jar location, commons-log properties values, and application classloader settings (Parent-First, Parent-Last, commons-log.jar bundled or not, etc) to achieve the desired results.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM