日期:2014-05-17  浏览次数:21000 次

log4j问题,帮忙看看啊
log4j配置:
# Output pattern : date [thread] priority category - message
log4j.rootLogger=WARN, Console, RollingFile, aliway
#, sqltiming
#Console
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n

#RollingFile
log4j.appender.RollingFile=org.apache.log4j.DailyRollingFileAppender
log4j.appender.RollingFile.File=logs/icommonweal.log
log4j.appender.RollingFile.layout=org.apache.log4j.PatternLayout
log4j.appender.RollingFile.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n


log4j.appender.aliway=org.apache.log4j.DailyRollingFileAppender
log4j.appender.aliway.File=logs/aliway.log
log4j.appender.aliway.layout=org.apache.log4j.PatternLayout
log4j.appender.aliway.layout.ConversionPattern=%d %r [%t] %-5p [%c]%n%m%n

#Project defalult level
log4j.logger.com.alibaba.icommonweal=INFO,Console,RollingFile
log4j.logger.com.alibaba.icommonweal.service.AliwayService=INFO,Console,aliway
log4j.logger.com.alibaba.icommonweal.service.impl.AliwayServiceImpl=INFO,Console,aliway
log4j.logger.com.alibaba.icommonweal.web.aliway.AliwayController=INFO,Console,aliway
log4j.logger.jdbc.sqltiming=INFO



log4j错误信息:
警告: Can not export pandora bundle classes. java.lang.NoSuchMethodException: com.taobao.hsf.container.HSFContainer.getExportedBundleClasses()
log4j:WARN File option not set for appender [remotingLogFile].
log4j:WARN Are you using FileAppender instead of ConsoleAppender?
log4j:ERROR Either File or DatePattern options are not set for appender [remotingLogFile].
log4j:ERROR No output stream or file set for the appender named [remotingLogFile].

log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
------解决方案--------------------
引用:
这地方改一下
log4j.appender.aliway.File=${catalina.home}/logs/aliway.log

log4j.appender.RollingFile.File=${catalina.home}/logs/icommonweal.log

还有这里