加载springPlugin后启动出现载入log4j错误

lvosc3mc 发布于 2013/07/08 14:03
阅读 960
收藏 0

使用默认的jfinal_demo 的log4j.properties 配置文件

--------------------------

log4j.rootLogger=WARN, stdout, file
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%n%-d{yyyy-MM-dd HH🇲🇲ss}%n[%p]-[Thread: %t]-[%C.%M()]: %m%n

# Output to the File
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.File=./jfinal_demo.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%n%-d{yyyy-MM-dd HH🇲🇲ss}%n[%p]-[Thread: %t]-[%C.%M()]: %m%n

----------------------------------

但是当配置spring插件后,me.add(new SpringPlugin()); 启动出现如下错误提示


-------------------------------------------

log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable.

log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
log4j:ERROR [sun.misc.Launcher$AppClassLoader@6b97fd] whereas object of type
log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by [WebAppClassLoader=29791654@1c695a6].
log4j:ERROR Could not instantiate appender named "stdout".
log4j:ERROR A "org.apache.log4j.FileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
log4j:ERROR [sun.misc.Launcher$AppClassLoader@6b97fd] whereas object of type
log4j:ERROR "org.apache.log4j.FileAppender" was loaded by [WebAppClassLoader=29791654@1c695a6].
log4j:ERROR Could not instantiate appender named "file".
加载中
0
JFinal
JFinal
log4j.properties 改过没? 检查一下 log4j  jar 包版本
返回顶部
顶部