-
Notifications
You must be signed in to change notification settings - Fork 617
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
Enhance and standardize logger Config setters #4051
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
timj-hh
force-pushed
the
logger_setters
branch
2 times, most recently
from
December 4, 2023 23:31
11be98f
to
28406bd
Compare
timj-hh
force-pushed
the
logger_setters
branch
from
December 5, 2023 00:00
28406bd
to
66189b1
Compare
timj-hh
force-pushed
the
logger_setters
branch
from
December 13, 2023 18:47
66189b1
to
263b7bb
Compare
timj-hh
force-pushed
the
logger_setters
branch
from
December 13, 2023 18:51
263b7bb
to
be90699
Compare
timj-hh
force-pushed
the
logger_setters
branch
from
December 13, 2023 18:58
be90699
to
ffd099e
Compare
timj-hh
force-pushed
the
logger_setters
branch
13 times, most recently
from
December 14, 2023 00:00
9b17a78
to
9484b4c
Compare
timj-hh
force-pushed
the
logger_setters
branch
from
December 14, 2023 23:20
175ecec
to
9c0eb6b
Compare
timj-hh
force-pushed
the
logger_setters
branch
from
December 15, 2023 17:07
9c0eb6b
to
c46e22b
Compare
amogh09
reviewed
Dec 18, 2023
timj-hh
force-pushed
the
logger_setters
branch
4 times, most recently
from
December 18, 2023 22:54
3096b59
to
7e523fa
Compare
amogh09
reviewed
Dec 18, 2023
amogh09
reviewed
Dec 18, 2023
timj-hh
force-pushed
the
logger_setters
branch
from
December 19, 2023 00:21
7e523fa
to
0d567c7
Compare
amogh09
previously approved these changes
Dec 19, 2023
timj-hh
force-pushed
the
logger_setters
branch
from
December 19, 2023 17:10
0d567c7
to
accf86b
Compare
timj-hh
force-pushed
the
logger_setters
branch
from
December 19, 2023 17:19
accf86b
to
123967a
Compare
ohsoo
approved these changes
Dec 19, 2023
amogh09
approved these changes
Dec 19, 2023
xxx0624
approved these changes
Dec 19, 2023
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This change enhances the access pattern for the Seelog configuration. Environment variables are currently used in
InitSeelog
when the agent is started to pass in logging values. After that, all changes to the logger should be managed by the Config struct.This is a follow up to #4048.
Implementation details
SetLevel
setter into driver and instance level functionsreloadConfig
in each setterlogLevels
mapping from ECS_LOGLEVEL to Seelog level options to a file wide variablelogToStdout
that will decide whether we should duplicate output to stdout or not. Currently, we are outputting to a rolling log file as well as stdout. The latter should be optional.seelogConfig
method with thislogToStdout
option.SetRolloverType
setter to modify the rollover type of the logs, if any. The default behavior has been kept as size in the agent module, and this also falls back to date based rolling. Passing in 'none' allows for no rollover policy.timestampFormat
from the Config object. This var is special in that it is actively used in runtime when a custom log formatter is used. There is a potential data race with the mutex lockedConfig
struct, so we can let this variable's setter directly access it without locks - knowing this will likely be used at startup and not runtime.Testing
Existing tests pass.
New unit tests
TestSeeLogConfig_WithoutStdout
,TestSeelogConfig_JSONNoStdout
, andTestSeelogConfig_JSONNoRollover
have been added to validate new logic.New tests cover the changes: no
Description for the changelog
Update logger Config setter access pattern
Does this PR include breaking model changes? If so, Have you added transformation functions?
no model breaking changes
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.