openfire 在eclipse中开启控制台显示日志

1、在启动配置项中设置classpath

 

2、修改openfire\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/">
<!-- 添加一个打印控制台的日志 -->
	<appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d [%24F:%-4L:%-5p][%x] -%m%n"/>
		</layout>
	</appender>

	<!-- OF-506: Jetty INFO messages are generally not useful. Ignore them by default. -->
	<logger name="org.eclipse.jetty">
		<level value="warn" />
	</logger>
	
   	<root>
	<!-- level value=debug 指定Log日志级别-->
		<level value="debug" />
<!--添加如下内容,表示要使用STDOUT -->
		<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>

 

 

你可能感兴趣的:(openfire)