-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optimize: optimize seata-server log pattern and support for colored log. #2788
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2788 +/- ##
=============================================
+ Coverage 50.19% 50.25% +0.05%
- Complexity 2921 2946 +25
=============================================
Files 578 587 +9
Lines 18724 18869 +145
Branches 2253 2268 +15
=============================================
+ Hits 9398 9482 +84
- Misses 8396 8449 +53
- Partials 930 938 +8
|
@wangliang1986 please explain the display comparison before and after modification. |
The comparison chart is in the description, please check it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, good job.
server/src/main/java/io/seata/server/logging/logback/ApplicationPid.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ⅰ. Describe what this PR did
seata-server端的日志相关优化:
1、日志格式调整,使日志更整齐。
2、控制台打印日志时,部分文字带颜色。
3、日志文件名拼接端口号,防止集群时部分日志写入失败。
4、日志文件按日志级别分开:txc.${port}.all.log、txc.${port}.warn.log、txc.${port}.error.log
5、历史日志文件,放入子文件夹/history中,且历史文件后缀名改为.gz
相关功能及日志格式,从spring-boot.jar中复制过来的,我只是搬运工,哈哈。
优化后的效果如下:
控制台输出:
日志文件输出:
优化前的效果如下:
控制台输出:
日志文件输出:
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews