简体   繁体   English

使用Websphere 8.0不会打印任何日志语句

[英]No log statement is printing using websphere 8.0

I have one application running in WAS8. 我有一个在WAS8中运行的应用程序。

  1. we have a jar - commons-logging-1.1.1.jar in WEB-INF/lib 我们有一个jar-WEB-INF / lib中的commons-logging-1.1.1.jar

  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 我们有一个属性文件-commons-logging.properties,文件内容的优先级为= 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. 我们在WebContent / META-INF / services中有org.apache.commons.logging.LogFactory文件。文件的内容是org.apache.commons.logging.impl.Log4jFactory已创建日志文件,但未写入任何内容。 It is not showing any error in the log files in log of appserver. 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. 请注意:如果我将commons-logging.properties保留在/ opt / IBM / WebSphere / 80 / AppServer / profiles / AppSrv01 / properties中,则它可以很好地工作。 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). 如果不需要为您的Web应用程序提供单独的日志文件,则只需从模块(war)中删除commons-log jar和属性,您的日志语句就会根据中的日志级别设置写入SystemOut.log。 WebSphere控制台(可以在运行时进行更改)。

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. 如果必须分开应用程序日志记录,则可以参考此信息中心文章 ,其中介绍了commons-log jar位置,commons-log属性值和应用程序类加载器设置(Parent-First,Parent-Last,commons-log.jar)的组合捆绑与否等)以达到理想的效果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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