Skip to content
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

Merged
merged 19 commits into from
Jun 19, 2020

Conversation

wangliang181230
Copy link
Contributor

@wangliang181230 wangliang181230 commented Jun 10, 2020

Ⅰ. 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中复制过来的,我只是搬运工,哈哈。

优化后的效果如下:

控制台输出:
after-console
日志文件输出:
after-file

优化前的效果如下:

控制台输出:
before-console
日志文件输出:
before-file

Ⅱ. 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

@codecov-commenter
Copy link

codecov-commenter commented Jun 10, 2020

Codecov Report

Merging #2788 into develop will increase coverage by 0.05%.
The diff coverage is 53.61%.

Impacted file tree graph

@@              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     
Impacted Files Coverage Δ Complexity Δ
...ava/io/seata/core/constants/ConfigurationKeys.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...in/java/io/seata/core/constants/DefaultValues.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...va/io/seata/core/rpc/netty/RpcServerBootstrap.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...src/main/java/io/seata/server/ParameterParser.java 48.64% <0.00%> (+2.81%) 8.00 <3.00> (-3.00) ⬆️
server/src/main/java/io/seata/server/Server.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
.../src/main/java/io/seata/server/env/PortHelper.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...ing/logback/WhitespaceThrowableProxyConverter.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...main/java/io/seata/server/env/ContainerHelper.java 14.28% <14.28%> (ø) 2.00 <2.00> (?)
.../seata/server/logging/logback/ansi/AnsiOutput.java 42.10% <42.10%> (ø) 6.00 <6.00> (?)
.../listener/SystemPropertyLoggerContextListener.java 46.66% <46.66%> (ø) 3.00 <3.00> (?)
... and 15 more

@slievrly
Copy link
Member

@wangliang1986 please explain the display comparison before and after modification.

@wangliang181230
Copy link
Contributor Author

@wangliang1986 please explain the display comparison before and after modification.

The comparison chart is in the description, please check it.

@wangliang181230 wangliang181230 changed the title optimize: Optimize seata-server log pattern. optimize: Optimize seata-server log. Jun 11, 2020
@wangliang181230 wangliang181230 changed the title optimize: Optimize seata-server log. optimize: Optimize seata-server log pattern and color. Jun 11, 2020
@wangliang181230 wangliang181230 changed the title optimize: Optimize seata-server log pattern and color. optimize: Optimize seata-server log pattern and support for colored log. Jun 13, 2020
Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good job.

@slievrly slievrly added the module/server server module label Jun 17, 2020
Copy link
Member

@jsbxyyx jsbxyyx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@slievrly slievrly changed the title optimize: Optimize seata-server log pattern and support for colored log. optimize: optimize seata-server log pattern and support for colored log. Jun 19, 2020
@slievrly slievrly merged commit a428685 into apache:develop Jun 19, 2020
@wangliang181230 wangliang181230 deleted the server-log-pattern branch June 19, 2020 08:01
@slievrly slievrly added this to the 1.3.0 milestone Jun 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/server server module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants