-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
server: add support for log rotation #12774
Conversation
3d8690d
to
fa35583
Compare
Codecov Report
@@ Coverage Diff @@
## master #12774 +/- ##
==========================================
- Coverage 64.23% 63.02% -1.22%
==========================================
Files 404 415 +11
Lines 32504 32321 -183
==========================================
- Hits 20880 20371 -509
- Misses 9490 9910 +420
+ Partials 2134 2040 -94
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
7dfe87c
to
84d8c03
Compare
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.
As discussed in the other comment, marking as 'Request changes' due to
"--log_rotation_lumberjack_json={...}" idea.
cc @lilic |
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
Codecov Report
@@ Coverage Diff @@
## master #12774 +/- ##
==========================================
+ Coverage 62.06% 62.95% +0.89%
==========================================
Files 399 408 +9
Lines 32753 34243 +1490
==========================================
+ Hits 20327 21557 +1230
- Misses 10359 10505 +146
- Partials 2067 2181 +114
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
How stable is |
@ptabor Does k8s support any built-in log rotation? |
@xiang90 lumberjack is used by kube-apiserver for audit logs[1]. That was my reason for choosing it and the direct reference to its use case in zap FAQ[2]. [1] https://github.com/kubernetes/apiserver/blob/fa8a40ce7f57e4ffeb1b811dca2dbed9209d7795/pkg/server/options/audit.go#L27 |
It was implemented in KAS[1] almost 4 years ago so I feel like this should be pretty stable. But I am open to alternatives of course. |
@serathius has a lot of experience with observability aspects of k8s. PTAL |
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
Updated to reflect previous comments will rebase when review is complete |
LGTM. defer to @ptabor. |
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
Looks good to me. Thank you. |
Bug 1958405: UPSTREAM: <carry>: server: add support for log rotation (etcd-io#12774)
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
This reverts commit 490e5c6.
This PR adds the option to have
lumberjack
[1] manage log rotation for file paths defined inlog-output
. The flag--log-rotation-config-json
accepts a JSON config directly reducing the footprint for enabling the feature. Currently, the implementation supports log rotation of a single file target as outlined in the example below. A similar approach is taken by kube-apiserver for audit logs.[2]new flags
example usage
[1] http://github.com/natefinch/lumberjack/
[2] https://github.com/kubernetes/apiserver/blob/fa8a40ce7f57e4ffeb1b811dca2dbed9209d7795/pkg/server/options/audit.go#L27