Initial commit
This commit is contained in:
0
src/main/resources/application.properties
Normal file
0
src/main/resources/application.properties
Normal file
27
src/main/resources/log4j2-spring.xml
Normal file
27
src/main/resources/log4j2-spring.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--<Configuration strict="true" xmlns="http://logging.apache.org/log4j/2.0/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://logging.apache.org/log4j/2.0/config https://raw.githubusercontent.com/apache/logging-log4j2/master/log4j-core/src/main/resources/Log4j-config.xsd">-->
|
||||
<Configuration>
|
||||
<Appenders>
|
||||
<Console name="console" target="SYSTEM_OUT">
|
||||
<PatternLayout disableAnsi="false">
|
||||
<Pattern>
|
||||
%style{%d{MM-dd-yyyy HH:mm:ss.SSSZ}}{bright, black} %highlight{%5p} %style{function=}{bright, black}%style{%50.50replace{%c{0}.%M}{}{}}{blue, bright} %style{requestId=%36.36X{requestId}}{bright, black} %style{username=%X{username}}{bright, black} %highlight{---} %message%n
|
||||
</Pattern>
|
||||
</PatternLayout>
|
||||
</Console>
|
||||
<RollingRandomAccessFile name="file" fileName="cipherStreamWeb.log" immediateFlush="true">
|
||||
<JsonTemplateLayout eventTemplateUri="classpath:template.json"></JsonTemplateLayout>
|
||||
<Policies>
|
||||
<SizeBasedTriggeringPolicy size="10MB"/>
|
||||
</Policies>
|
||||
<DefaultRolloverStrategy max="20"/>
|
||||
</RollingRandomAccessFile>
|
||||
</Appenders>
|
||||
|
||||
<Loggers>
|
||||
<Root level="info" includeLocation="true">
|
||||
<AppenderRef ref="console"/>
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
37
src/main/resources/template.json
Normal file
37
src/main/resources/template.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"timestamp": {
|
||||
"$resolver": "timestamp",
|
||||
"pattern": {
|
||||
"format": "yyy-MM-dd HH:mm:ss.SSSZ"
|
||||
}
|
||||
},
|
||||
"level": {
|
||||
"$resolver": "level",
|
||||
"field": "name"
|
||||
},
|
||||
"requestId": {
|
||||
"$resolver": "mdc",
|
||||
"key": "requestId"
|
||||
},
|
||||
"message": {
|
||||
"$resolver": "message",
|
||||
"stringified": true
|
||||
},
|
||||
"exception": {
|
||||
"exception_class": {
|
||||
"$resolver": "exception",
|
||||
"field": "className"
|
||||
},
|
||||
"exception_message": {
|
||||
"$resolver": "exception",
|
||||
"field": "message"
|
||||
},
|
||||
"stacktrace": {
|
||||
"$resolver": "exception",
|
||||
"field": "stackTrace",
|
||||
"stackTrace": {
|
||||
"stringified": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user