posts - 57, comments - 4, trackbacks - 0, articles - 10
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

log4j:WARN No appenders could be found for logger (org.apache.catalina.startup.TldConfig).
log4j:WARN Please initialize the log4j system properly.
的问题解决:
将log4j.properties放到 "WEB-INF"classes中, 搞定。

其中log4j.properties配置如下:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<!-- log4j configuration file -->
<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>
    <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
        <param name="target" value="System.out" />
        <param name="Threshold" value="debug"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p %m%n" />
        </layout>
    </appender>

    <!-- org.apache类的log全部记录到这里来-->
<logger name="org.apache" additivity="true">
<level value="info" />   
<appender-ref ref="CONSOLE" />
</logger>

<logger name="com.bitfone.mprove.console" additivity="true">
<level value="debug" />
<appender-ref ref="CONSOLE" />
</logger>
<!--这个地方不注释掉,好像容易引起双重logger
    <root>
        <priority value="info"/>
        <appender-ref ref="CONSOLE" />
    </root>
-->
</log4j:configuration>
### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
### root logger option ###
log4j.rootLogger=warn, stdout
### Hibernate logging options ###
log4j.logger.net.sf.hibernate=info
### log JDBC bind parameters ###
log4j.logger.net.sf.hibernate.type=info
### log PreparedStatement cache activity ###
log4j.logger.net.sf.hibernate.ps.PreparedStatementCache=info


评论

# re: log4j:WARN No appenders could be found for logger  回复  更多评论   

2012-05-19 10:52 by 怀念友爱相随
请问一下
log4j:WARN No appenders could be found for logger (com.opensymphony.xwork2.config.providers.XmlConfigurationProvider).
log4j:WARN Please initialize the log4j system properly.
这个问题要怎么解决?谢谢!

只有注册用户登录后才能发表评论。


网站导航: