Commit 660cb329 by WeiCong

人行使用log4j2.xml

parent fbf99d92
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{yyyy-MM-dd'T'HH:mm:ss.SSS} [%-10t] %-5level %c{1} %ex{full} - %msg%n"/>
</Console>
<!--自定义appender-->
<!-- <XXXFileAppender name="xxx" fileName="log.log" xxx="true">
<PatternLayout pattern="%d{yyyy-MM-dd'T'HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</XXXFileAppender>-->
<JDBC name="databaseAppender" tableName="test.log">
<ThresholdFilter level="ERROR" onMatch="ACCEPT" onMismatch="DENY"/>
<ConnectionFactory class="org.sss.presentation.noui.log.db.ConnectionFactory"
method="getDatabaseConnection"/>
<Column name="ID" literal="'XXX'"/>
<Column name="MESSAGE" pattern="%message"/>
<Column name="LEV" pattern="%level"/>
<Column name="LOGGER" pattern="%logger"/>
<Column name="THROWABLE" pattern="%msg %ex{full}"/>
<Column name="eventDate" isEventTimestamp="true"/>
</JDBC>
</Appenders>
<Loggers>
<!--异步方式入库-->
<!--<AsyncLogger name="org.sss" level="ERROR" includeLocation="true" additivity="false">
<AppenderRef ref="databaseAppender"/>
</AsyncLogger>-->
<!--<Logger name="org.sss" level="INFO" additivity="false">
<Filters>
<ThresholdFilter level="INFO" onMatch="NEUTRAL" onMismatch="DENY"/>
<RegexFilter regex="测试.*" onMatch="NEUTRAL" onMismatch="DENY"/>
<TimeFilter start="05:00:00" end="23:30:00" onMatch="NEUTRAL" onMismatch="DENY"/>
</Filters>
<AppenderRef ref="Console"/>
</Logger>-->
<AsyncLogger name="org.sss" level="INFO" includeLocation="true" additivity="true">
<AppenderRef ref="databaseAppender"/>
</AsyncLogger>
<AsyncLogger name="org.hibernate" level="ERROR" includeLocation="true">
<AppenderRef ref="databaseAppender"/>
</AsyncLogger>
<AsyncLogger name="org.apache" level="ERROR" includeLocation="true">
<AppenderRef ref="databaseAppender"/>
</AsyncLogger>
<AsyncLogger name="com.opensymphony" level="ERROR" includeLocation="true">
<AppenderRef ref="databaseAppender"/>
</AsyncLogger>
<Root level="ALL">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment