这个问题提出来一直没人解决,最后找到毛病了,发在这里
生产系统升级后发现接口无法打印日志,web层无法打印,service层可以打印,检查日志发现:
[09-12-15 15:53:45:617 CST] 00000030 SystemErr R log4j:ERROR Could not find value for key log4j.appender.appfile.layout
[09-12-15 15:53:45:618 CST] 00000030 SystemErr R log4j:WARN File option not set for appender [appfile].
[09-12-15 15:53:45:618 CST] 00000030 SystemErr R log4j:WARN Are you using FileAppender instead of ConsoleAppender?
[09-12-15 15:53:45:618 CST] 00000030 SystemErr R log4j:ERROR Either File or DatePattern options are not set for appender [appfile].
搜索到解决办法为:
在目录:
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/properties
增加一个文件名:
commons-logging.properties
内容为
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
问题解决
或者在程序中增加
if ( System.getProperty("log4j.configuration") != null )
PropertyConfigurator.configure(System.getProperty("log4j.configuration"));
else
BasicConfigurator.configure();
标签:00000030,打印,15,SystemErr,45,09,日志,log4j
From: https://blog.51cto.com/u_16174476/6604029