eclipse 开发 openfire 控制台输出日志(无聊的备忘)
? ? ?eclipse 控制台上没有日志很郁闷 ,修改 ?\build\lib\dist\log4j.xml
?
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
? ? <!-- add -->
? ? <appender name="STDOUT" value="${openfireHome}/logs/debug.log" />
<param name="MaxFileSize" value="1024KB"/>
<param name="MaxBackupIndex" value="5"/>
<layout value="%d{yyyy.MM.dd HH:mm:ss} %c - %m%n" />
</layout>
<filter value="debug" />
<param name="AcceptOnMatch" value="true" />
</filter>
</appender>
?
<appender name="info-out" value="${openfireHome}/logs/info.log" />
<param name="MaxFileSize" value="1024KB"/>
<param name="MaxBackupIndex" value="5"/>
<layout value="%d{yyyy.MM.dd HH:mm:ss} %c - %m%n" />
</layout>
<filter value="info" />
<param name="LevelMin" value="info" />
<param name="AcceptOnMatch" value="true" />
</filter>
</appender>
?
<appender name="warn-out" value="${openfireHome}/logs/warn.log" />
<param name="MaxFileSize" value="1024KB"/>
<param name="MaxBackupIndex" value="5"/>
<layout value="%d{yyyy.MM.dd HH:mm:ss} %c - %m%n" />
</layout>
<filter value="warn" />
<param name="LevelMin" value="warn" />
<param name="AcceptOnMatch" value="true" />
</filter>
</appender>
?
<appender name="error-out" value="${openfireHome}/logs/error.log" />
<param name="MaxFileSize" value="1024KB"/>
<param name="MaxBackupIndex" value="5"/>
<layout value="%d{yyyy.MM.dd HH:mm:ss} %c - %m%n" />
</layout>
<filter value="error" />
<param name="AcceptOnMatch" value="true" />
</filter>
</appender>
<!-- add -->
<logger name="java.sql.Connection">
<level value="DEBUG" />
</logger>
<!-- ?-->
? ?<root>
<level value="info" />
<!-- add -->
<appender-ref ref="STDOUT" />
<!-- ?-->
<appender-ref ref="debug-out" />
<appender-ref ref="info-out" />
<appender-ref ref="warn-out" />
<appender-ref ref="error-out" />
</root>
?
</log4j:configuration>