Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nouiWithSpringMVC
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gechengyang
nouiWithSpringMVC
Commits
660cb329
Commit
660cb329
authored
Aug 28, 2020
by
WeiCong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人行使用log4j2.xml
parent
fbf99d92
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
log4j2.xml
src/main/resources/log4j2.xml
+55
-0
No files found.
src/main/resources/log4j2.xml
0 → 100644
View file @
660cb329
<?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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment