本站首页    管理页面    写新日志    退出


«September 2025»
123456
78910111213
14151617181920
21222324252627
282930


公告

戒除浮躁,读好书,交益友


我的分类(专题)

日志更新

最新评论

留言板

链接

Blog信息
blog名称:邢红瑞的blog
日志总数:523
评论数量:1142
留言数量:0
访问次数:9708009
建立时间:2004年12月20日




[java语言]commons-logging结合Log4j的问题
原创空间,  软件技术

邢红瑞 发表于 2005/8/23 17:56:01

最近诸事不顺,升级Commons Logging居然出了问题,把Commons Logging升级到1.0.4,启动服务器出现了 java.lang.NoSuchMethodError: org.apache.log4j.Category.log(Ljava/lang/String;Lorg/apache/log4j/Level;Ljava/lang/Object;Ljava/lang/Throwable;)V  at org.apache.commons.logging.impl.Log4JCategoryLog.debug(Log4JCategoryLog.java:94) 认为是log4j的问题 ,把log4j升级到1.2.9,还是不行,升级到1.2.11,错误依旧,只好看源码了,Log4JCategoryLog.java中,有这末一句,"deprecated Use {@link Log4JLogger} instead",原来是class目录下commons-logging.properties的问题 原来的commons-logging.properties org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCategoryLog 更改后的commons-logging.properties org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger class目录下log4j..properties文件配置信息 # For JBoss: Avoid to setup Log4J outside $JBOSS_HOME/server/default/deploy/log4j.xml!# For all other servers: Comment out the Log4J listener in web.xml to activate Log4J.#log4j.rootLogger=INFO, stdout, logfilelog4j.rootLogger=INFO,stdout,logfile log4j.appender.stdout=org.apache.log4j.ConsoleAppenderlog4j.appender.stdout.layout=org.apache.log4j.PatternLayoutlog4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n log4j.appender.logfile=org.apache.log4j.RollingFileAppenderlog4j.appender.logfile.File=${tatan.root}/log/ebook.loglog4j.appender.logfile.MaxFileSize=512KB# Keep three backup files.log4j.appender.logfile.MaxBackupIndex=0# Pattern to output: date priority [category] - messagelog4j.appender.logfile.layout=org.apache.log4j.PatternLayoutlog4j.appender.logfile.layout.ConversionPattern=%d %p [%c] - %m%n # If programmed properly the most messages would be at DEBUG # and the least at FATAL. log4j.logger.com.tatan.dao.jdbc=DEBUGlog4j.logger.com.tatan.service.impl=DEBUG 注意不要多写stdout,log4j.logger.com.tatan.Myclass=DEBUG, stdout,它会会继承root的appender ,会重复输出了 webapproot的配置 <context-param>  <param-name>webAppRootKey</param-name>  <param-value>ebook.root</param-value> </context-param>


阅读全文(13069) | 回复(8) | 编辑 | 精华
 


回复:commons-logging结合Log4j的问题
原创空间,  软件技术

sunfy(游客)发表评论于2006/9/13 10:27:24

thanx so much.i got puzzled for long time and solved the problem with the hepl of ur post.


个人主页 | 引用回复 | 主人回复 | 返回 | 编辑 | 删除
 


回复:commons-logging结合Log4j的问题
原创空间,  软件技术

asfd(游客)发表评论于2006/6/10 16:48:22

非常感谢,正需要解决这个问题

个人主页 | 引用回复 | 主人回复 | 返回 | 编辑 | 删除
 


回复:commons-logging结合Log4j的问题
原创空间,  软件技术

jamjar(游客)发表评论于2006/5/11 8:57:38

困扰了很久的问题,多谢大侠啊

个人主页 | 引用回复 | 主人回复 | 返回 | 编辑 | 删除
 


回复:commons-logging结合Log4j的问题
原创空间,  软件技术

oldreams(游客)发表评论于2006/4/13 14:55:54

厉害啊,多谢大虾

个人主页 | 引用回复 | 主人回复 | 返回 | 编辑 | 删除
 


回复:commons-logging结合Log4j的问题
原创空间,  软件技术

haha(游客)发表评论于2006/3/17 14:54:10

谢谢,一天了,终于在这里找到了答案

个人主页 | 引用回复 | 主人回复 | 返回 | 编辑 | 删除
 


回复:commons-logging结合Log4j的问题
原创空间,  软件技术

joseph牛牛(游客)发表评论于2005/12/9 14:43:23

好例子:)

个人主页 | 引用回复 | 主人回复 | 返回 | 编辑 | 删除
 


回复:commons-logging结合Log4j的问题
原创空间,  软件技术

aq(游客)发表评论于2005/11/21 10:46:38

原来如此

个人主页 | 引用回复 | 主人回复 | 返回 | 编辑 | 删除
 


回复:commons-logging结合Log4j的问题
原创空间,  软件技术

yunchat(游客)发表评论于2005/8/26 17:13:23

好,  我还在奇怪新下载的commons-longging 包下杂没了Log4JCategoryLog这类呢

个人主页 | 引用回复 | 主人回复 | 返回 | 编辑 | 删除
 


» 1 »

发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.049 second(s), page refreshed 144782132 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号