Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
武汉红喜
whatsmars
提交
818391c1
W
whatsmars
项目概览
武汉红喜
/
whatsmars
通知
3
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
whatsmars
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
818391c1
编写于
8月 16, 2020
作者:
武汉红喜
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
whatsmars-boot-sample-log4j2
上级
09d1e0a4
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
69 addition
and
40 deletion
+69
-40
whatsmars-spring-boot-samples/pom.xml
whatsmars-spring-boot-samples/pom.xml
+1
-0
whatsmars-spring-boot-samples/whatsmars-boot-sample-datasource/pom.xml
...ing-boot-samples/whatsmars-boot-sample-datasource/pom.xml
+0
-10
whatsmars-spring-boot-samples/whatsmars-boot-sample-datasource/src/main/resources/mybatis-config.xml
...t-sample-datasource/src/main/resources/mybatis-config.xml
+0
-1
whatsmars-spring-boot-samples/whatsmars-boot-sample-log4j2/pom.xml
...-spring-boot-samples/whatsmars-boot-sample-log4j2/pom.xml
+31
-0
whatsmars-spring-boot-samples/whatsmars-boot-sample-log4j2/src/main/java/org/hongxi/whatsmars/boot/sample/log4j2/SampleLog4j2Application.java
...whatsmars/boot/sample/log4j2/SampleLog4j2Application.java
+27
-0
whatsmars-spring-boot-samples/whatsmars-boot-sample-log4j2/src/main/resources/log4j2.xml
...hatsmars-boot-sample-log4j2/src/main/resources/log4j2.xml
+8
-27
whatsmars-spring-boot-samples/whatsmars-boot-sample-logback/src/main/resources/application.yml
...rs-boot-sample-logback/src/main/resources/application.yml
+2
-2
未找到文件。
whatsmars-spring-boot-samples/pom.xml
浏览文件 @
818391c1
...
...
@@ -30,6 +30,7 @@
<module>
whatsmars-boot-sample-datasource
</module>
<module>
whatsmars-boot-sample-thymeleaf
</module>
<module>
whatsmars-boot-sample-swagger
</module>
<module>
whatsmars-boot-sample-log4j2
</module>
</modules>
<dependencies>
...
...
whatsmars-spring-boot-samples/whatsmars-boot-sample-datasource/pom.xml
浏览文件 @
818391c1
...
...
@@ -15,16 +15,6 @@
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter
</artifactId>
<exclusions>
<exclusion>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-logging
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-log4j2
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
whatsmars-spring-boot-samples/whatsmars-boot-sample-datasource/src/main/resources/mybatis-config.xml
浏览文件 @
818391c1
...
...
@@ -4,7 +4,6 @@
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<settings>
<setting
name=
"logImpl"
value=
"LOG4J2"
/>
<setting
name=
"callSettersOnNulls"
value=
"true"
/>
<setting
name=
"mapUnderscoreToCamelCase"
value=
"true"
/>
</settings>
...
...
whatsmars-spring-boot-samples/whatsmars-boot-sample-log4j2/pom.xml
0 → 100644
浏览文件 @
818391c1
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
whatsmars-spring-boot-samples
</artifactId>
<groupId>
org.hongxi
</groupId>
<version>
Rocket.S9
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
whatsmars-boot-sample-log4j2
</artifactId>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter
</artifactId>
<exclusions>
<exclusion>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-logging
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-log4j2
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
whatsmars-spring-boot-samples/whatsmars-boot-sample-log4j2/src/main/java/org/hongxi/whatsmars/boot/sample/log4j2/SampleLog4j2Application.java
0 → 100644
浏览文件 @
818391c1
package
org.hongxi.whatsmars.boot.sample.log4j2
;
import
javax.annotation.PostConstruct
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
public
class
SampleLog4j2Application
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SampleLog4j2Application
.
class
);
@PostConstruct
public
void
logSomething
()
{
logger
.
debug
(
"Sample Debug Message"
);
logger
.
trace
(
"Sample Trace Message"
);
}
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
SampleLog4j2Application
.
class
,
args
).
close
();
}
}
\ No newline at end of file
whatsmars-spring-boot-samples/whatsmars-boot-sample-
datasource
/src/main/resources/log4j2.xml
→
whatsmars-spring-boot-samples/whatsmars-boot-sample-
log4j2
/src/main/resources/log4j2.xml
浏览文件 @
818391c1
...
...
@@ -2,7 +2,7 @@
<configuration
status=
"info"
>
<properties>
<property
name=
"log.path"
>
/
data/logs/whatsmars-boot-sample-datasource
</property>
<property
name=
"log.path"
>
/
tmp/logs/whatsmars-boot-sample-log4j2
</property>
</properties>
<appenders>
...
...
@@ -11,7 +11,7 @@
<ThresholdFilter
level=
"DEBUG"
onMatch=
"ACCEPT"
onMismatch=
"DENY"
/>
</Filters>
<PatternLayout
pattern=
"[%d{yyyy-MM-dd HH:mm:s
tack:SSS}] [%p] [%t] - [%X{sid}]
%c{1.} - %m%n"
/>
<PatternLayout
pattern=
"[%d{yyyy-MM-dd HH:mm:s
s,SSS}] [%p] [%t] -
%c{1.} - %m%n"
/>
</console>
<RollingFile
name=
"RollingFileDebug"
fileName=
"${log.path}/debug.log"
...
...
@@ -22,7 +22,7 @@
<ThresholdFilter
level=
"DEBUG"
onMatch=
"ACCEPT"
onMismatch=
"DENY"
/>
</Filters>
<PatternLayout
pattern=
"[%d{yyyy-MM-dd HH:mm:s
tack:SSS}] [%p] [%t] - [%X{sid}]
%c{1.} - %m%n"
/>
<PatternLayout
pattern=
"[%d{yyyy-MM-dd HH:mm:s
s,SSS}] [%p] [%t] -
%c{1.} - %m%n"
/>
<Policies>
<TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy
size=
"100 MB"
/>
...
...
@@ -36,7 +36,7 @@
<ThresholdFilter
level=
"WARN"
onMatch=
"DENY"
onMismatch=
"NEUTRAL"
/>
</Filters>
<PatternLayout
pattern=
"[%d{yyyy-MM-dd HH:mm:s
tack:SSS}] [%p] [%t] - [%X{sid}]
%c{1.} - %m%n"
/>
<PatternLayout
pattern=
"[%d{yyyy-MM-dd HH:mm:s
s,SSS}] [%p] [%t] -
%c{1.} - %m%n"
/>
<Policies>
<TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy
size=
"100 MB"
/>
...
...
@@ -50,7 +50,7 @@
<ThresholdFilter
level=
"ERROR"
onMatch=
"DENY"
onMismatch=
"NEUTRAL"
/>
</Filters>
<PatternLayout
pattern=
"[%d{yyyy-MM-dd HH:mm:s
tack:SSS}] [%p] [%t] - [%X{sid}]
%c{1.} - %m%n"
/>
<PatternLayout
pattern=
"[%d{yyyy-MM-dd HH:mm:s
s,SSS}] [%p] [%t] -
%c{1.} - %m%n"
/>
<Policies>
<TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy
size=
"100 MB"
/>
...
...
@@ -60,7 +60,7 @@
<RollingFile
name=
"RollingFileError"
fileName=
"${log.path}/error.log"
filePattern=
"${log.path}/$${date:yyyy-MM-dd}/error-%d{yyyy-MM-dd}-%i.log"
>
<ThresholdFilter
level=
"ERROR"
/>
<PatternLayout
pattern=
"[%d{yyyy-MM-dd HH:mm:s
tack:SSS}] [%p] [%t] - [%X{sid}]
%c{1.} - %m%n"
/>
<PatternLayout
pattern=
"[%d{yyyy-MM-dd HH:mm:s
s,SSS}] [%p] [%t] -
%c{1.} - %m%n"
/>
<Policies>
<TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy
size=
"100 MB"
/>
...
...
@@ -70,7 +70,7 @@
<RollingFile
name=
"RollingFileTrace"
fileName=
"${log.path}/trace.log"
filePattern=
"${log.path}/$${date:yyyy-MM-dd}/trace-%d{yyyy-MM-dd}-%i.log"
>
<ThresholdFilter
level=
"TRACE"
onMatch=
"ACCEPT"
onMismatch=
"DENY"
/>
<PatternLayout
pattern=
"[%d{yyyy-MM-dd HH:mm:s
tack:SSS}] [%p] [%t] - [%X{sid}]
%c{1.} - %m%n"
/>
<PatternLayout
pattern=
"[%d{yyyy-MM-dd HH:mm:s
s,SSS}] [%p] [%t] -
%c{1.} - %m%n"
/>
<Policies>
<TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy
size=
"100 MB"
/>
...
...
@@ -79,7 +79,7 @@
</appenders>
<loggers>
<root
level=
"
INFO
"
>
<root
level=
"
DEBUG
"
>
<appender-ref
ref=
"Console"
/>
<appender-ref
ref=
"RollingFileInfo"
/>
<appender-ref
ref=
"RollingFileWarn"
/>
...
...
@@ -87,25 +87,6 @@
<appender-ref
ref=
"RollingFileDebug"
/>
<appender-ref
ref=
"RollingFileTrace"
/>
</root>
<!-- mybatis loggers -->
<logger
name=
"com.ibatis"
level=
"INFO"
/>
<logger
name=
"org.apache.ibatis"
level=
"INFO"
/>
<logger
name=
"org.mybatis.spring"
level=
"INFO"
/>
<logger
name=
"com.ibatis.common.jdbc.SimpleDataSource"
level=
"INFO"
/>
<logger
name=
"com.ibatis.common.jdbc.ScriptRunner"
level=
"DEBUG"
/>
<logger
name=
"com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate"
level=
"DEBUG"
/>
<!-- sql loggers -->
<logger
name=
"java.sql.Connection"
level=
"DEBUG"
additivity=
"true"
/>
<logger
name=
"java.sql.Statement"
level=
"DEBUG"
additivity=
"true"
/>
<logger
name=
"java.sql.PreparedStatement"
level=
"DEBUG"
additivity=
"true"
/>
<logger
name=
"java.sql.ResultSet"
level=
"DEBUG"
additivity=
"true"
/>
<!-- spring loggers -->
<logger
name=
"org.springframework"
level=
"WARN"
/>
<logger
name=
"org.springframework.web"
level=
"WARN"
/>
<logger
name=
"springfox.documentation"
level=
"WARN"
/>
<logger
name=
"org.hibernate"
level=
"ERROR"
/>
<logger
name=
"springfox.documentation"
level=
"ERROR"
/>
</loggers>
</configuration>
\ No newline at end of file
whatsmars-spring-boot-samples/whatsmars-boot-sample-logback/src/main/resources/application.yml
浏览文件 @
818391c1
logging.level.org.springframework.boot
:
DEBUG
logging
:
file
:
.
/logs/whatsmars/whatsmars.log
file-rolling
:
.
/logs/whatsmars/%d{yyyy-MM}/whatsmars.log
file
:
/tmp
/logs/whatsmars/whatsmars.log
file-rolling
:
/tmp
/logs/whatsmars/%d{yyyy-MM}/whatsmars.log
max-file-size
:
100MB
max-history
:
365
total-size-cap
:
20GB
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录