如何关闭一大堆debug 打印日志,使用的 Log logger = Logs.get()
4 回复
我使用的是log4j2.
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="off" monitorInterval="1800" >
<properties>
<property name="LOG_HOME">/data/GM/file</property>
<property name="ERROR_LOG">error</property>
</properties>
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p (%F:%L) -DDS %m%n" />
</Console>
<RollingRandomAccessFile name="ErrorLog" fileName="${LOG_HOME}/${ERROR_LOG}/GmError.log" filePattern="${LOG_HOME}/${ERROR_LOG}/GmError_%d{yyyy-MM-dd}.log">
<PatternLayout pattern="%d %-5p (%F:%L) - %m%n"/>
<Policies>
<TimeBasedTriggeringPolicy interval="1"/>
<SizeBasedTriggeringPolicy size="32 MB"/>
</Policies>
<DefaultRolloverStrategy max="20"/>
</RollingRandomAccessFile>
</Appenders>
<Loggers>
<root level="info">
<appender-ref ref="ErrorLog" level="error"/>
<appender-ref ref="Console" level="info"/>
</root>
</Loggers>
</Configuration>
这样配置有问题吗?路径是在resource下面
添加回复
请先登陆