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

[Draft] etcd: Support configuring zap console log format with --log-format flag #12967

Closed
wants to merge 1 commit into from

Conversation

serathius
Copy link
Member

Console format is much easier to read during development when compared
to json.

Example:

2021-05-14T12:11:46.513+0200    info    etcdmain/etcd.go:72     Running:        {"args": ["./bin/etcd", "--log-format=console"]}
2021-05-14T12:11:46.514+0200    warn    etcdmain/etcd.go:104    'data-dir' was empty; using default     {"data-dir": "default.etcd"}
2021-05-14T12:11:46.514+0200    info    etcdmain/etcd.go:115    server has been already initialized     {"data-dir": "default.etcd", "dir-type": "member"}
2021-05-14T12:11:46.514+0200    info    embed/etcd.go:131       configuring peer listeners      {"listen-peer-urls": ["http://localhost:2380"]}
2021-05-14T12:11:46.515+0200    info    embed/etcd.go:139       configuring client listeners    {"listen-client-urls": ["http://localhost:2379"]}

Please read https://github.com/etcd-io/etcd/blob/master/CONTRIBUTING.md#contribution-flow.

@serathius
Copy link
Member Author

cc @ptabor

Console format is much easier to read during development when compared
to json.
@codecov-commenter
Copy link

Codecov Report

Merging #12967 (fc0956c) into main (7ba53c7) will increase coverage by 6.24%.
The diff coverage is 77.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #12967      +/-   ##
==========================================
+ Coverage   62.73%   68.97%   +6.24%     
==========================================
  Files         417      410       -7     
  Lines       33332    33651     +319     
==========================================
+ Hits        20910    23212    +2302     
+ Misses      10338     8483    -1855     
+ Partials     2084     1956     -128     
Flag Coverage Δ
all 68.97% <77.77%> (+6.24%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
server/embed/config_logging.go 74.00% <33.33%> (+24.67%) ⬆️
server/embed/config.go 71.00% <100.00%> (+25.31%) ⬆️
server/etcdmain/config.go 83.19% <100.00%> (+2.94%) ⬆️
raft/quorum/quorum.go 0.00% <0.00%> (-100.00%) ⬇️
raft/tracker/state.go 0.00% <0.00%> (-100.00%) ⬇️
raft/util.go 22.42% <0.00%> (-63.56%) ⬇️
raft/confchange/restore.go 39.53% <0.00%> (-55.82%) ⬇️
raft/raftpb/confchange.go 22.97% <0.00%> (-52.71%) ⬇️
raft/quorum/voteresult_string.go 0.00% <0.00%> (-50.00%) ⬇️
raft/logger.go 15.38% <0.00%> (-42.31%) ⬇️
... and 179 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ba53c7...fc0956c. Read the comment docs.

@serathius
Copy link
Member Author

Discussed with @ptabor how we want to approach adding new configuration flags. We will go with same approach as log rotation, allowing users to pass full zap config as JSON. #12774 (comment)

@ptabor ptabor marked this pull request as draft May 14, 2021 21:25
@serathius serathius changed the title etcd: Support configuring zap console log format with --log-format flag [Draft] etcd: Support configuring zap console log format with --log-format flag Aug 6, 2021
@stale
Copy link

stale bot commented Nov 5, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 5, 2021
@stale stale bot closed this Nov 26, 2021
@serathius serathius deleted the console branch June 15, 2023 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants