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: change client.log.exceptionRate to log.exceptionRate #3247

Merged
merged 9 commits into from
Nov 23, 2020

Conversation

ls9527
Copy link
Contributor

@ls9527 ls9527 commented Nov 1, 2020

Ⅰ. Describe what this PR did

StackTraceLogger 打印的debug,info,error 日志会根据配置 client.log.exceptionRate 随机打印错误栈。
事实上info 日志在 rm, warn日志在tm, error 日志在tc. 所以 client 的前缀就不准确。 希望去掉client前缀

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

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

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

LGTM, use optimize: as the heading prefix

@funky-eyes funky-eyes added first-time contributor first-time contributor module/core core module labels Nov 2, 2020
@codecov-io
Copy link

codecov-io commented Nov 2, 2020

Codecov Report

Merging #3247 (8e2a563) into develop (be83b1e) will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #3247      +/-   ##
=============================================
- Coverage      50.88%   50.86%   -0.02%     
+ Complexity      3281     3278       -3     
=============================================
  Files            612      612              
  Lines          20113    20113              
  Branches        2519     2519              
=============================================
- Hits           10235    10231       -4     
- Misses          8852     8853       +1     
- Partials        1026     1029       +3     
Impacted Files Coverage Δ Complexity Δ
...ava/io/seata/core/constants/ConfigurationKeys.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...ta/spring/boot/autoconfigure/StarterConstants.java 100.00% <ø> (ø) 1.00 <0.00> (ø)
...torage/file/store/FileTransactionStoreManager.java 56.77% <0.00%> (-0.65%) 28.00% <0.00%> (-1.00%)
...o/seata/server/coordinator/DefaultCoordinator.java 54.63% <0.00%> (-0.52%) 28.00% <0.00%> (-1.00%)
...in/java/io/seata/server/session/GlobalSession.java 82.72% <0.00%> (-0.46%) 70.00% <0.00%> (-1.00%)

@ls9527 ls9527 changed the title change client.log.exceptionRate to log.exceptionRate optimize: change client.log.exceptionRate to log.exceptionRate Nov 2, 2020
@funky-eyes funky-eyes added this to the 1.5.0 milestone Nov 2, 2020
Copy link
Contributor

@caohdgege caohdgege left a comment

Choose a reason for hiding this comment

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

plz change LogProperties, otherwise seata could not read config from yml
&& plz change application.properties, config.txt, application.yml

需要修改一下LogProperties这个类,不然的话seata是没办法从yml(properties)文件读取配置,
同时需要把application.properties, config.txt, application.yml里面的配置项也对应修改一下

@@ -66,7 +66,7 @@ client {
logSerialization = "jackson"
logTable = "undo_log"
}
log {
}
log {
exceptionRate = 100
Copy link
Contributor

Choose a reason for hiding this comment

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

调一下缩进,强迫症

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

缩进改了, idea 的默认对其他类型的配置文件是4个空格的缩进。
可以通过加入 .editorconfig 配置文件, 对java,properties,yml.conf 等后缀的缩进排版统一。
如果这种事情发生的比较多, 就可以考虑一下。
反正idea能直接导出.editorconfig 文件, 在做一点点修改就可以了

@@ -151,7 +151,7 @@
"defaultValue": true
},
{
"name": "seata.client.log.exception-rate",
"name": "seata.log.exception-rate",
"type": "java.lang.Integer",
"sourceType": "io.seata.spring.boot.autoconfigure.properties.client.LogProperties",
Copy link
Contributor

Choose a reason for hiding this comment

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

LogProperties 这个类要改

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已改

Copy link
Contributor

@caohdgege caohdgege left a comment

Choose a reason for hiding this comment

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

LGMT, 顺便去官网提交一下pr修改一下对应的配置项

Copy link
Contributor

@caohdgege caohdgege left a comment

Choose a reason for hiding this comment

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

LGMT, 顺便去官网提交一下pr修改一下对应的配置项

Copy link
Contributor

@l81893521 l81893521 left a comment

Choose a reason for hiding this comment

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

LGTM

@l81893521 l81893521 merged commit 5e51d5e into apache:develop Nov 23, 2020
LiWenGu pushed a commit to LiWenGu/seata that referenced this pull request Dec 4, 2020
@wangliang181230 wangliang181230 modified the milestones: 1.5.0, 1.4.1 Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-time contributor first-time contributor module/core core module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants