-
Notifications
You must be signed in to change notification settings - Fork 101
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
Logger input Environment variables #338
Conversation
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.
Got the config propagation part, the logger itself is unclear. We didn't switch to the new one yet, do we?
@ytsarev, true, that's just config propagation, nothing else. The plan for PR's was
|
I suggest to discuss possible logging solutions conceptually before we proceed with PRs |
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.
Sounds like a plan 👍 Thanks a lot for the clarification
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.
Is it possible to stick to general log level configuration instead of using separate "debug" mode variable?
Same goes about "json" mode.
i.e. we can use:
LOGGER_FORMAT
setting with json
as one of the possible values,
and LOGGER_LOGLEVEL
with DEBUG
as one of possible values.
Each of logging solutions might also have their own concepts of configuration. We might need to investigate them.
@somaritane Actually, an interesting idea. I can change: zerolog allows for logging at the following levels (from highest to lowest), so I can take over
|
e090a59
to
9ea371e
Compare
74312d8
to
4c2d268
Compare
I removed |
ff5869b
to
525e616
Compare
@kuritka, what about helm chart, is it out of scope for this change? |
a9129c8
to
8a4762e
Compare
Code implements depresolver part - logger inputs Input variables defines how will looger act. - propagation new config variables: ~~`LOGGER_DEBUG_MODE`~~,~~`LOGGER_JSON_MODE`~~,`LOG_FORMAT `,`LOG_LEVEL` - All covered by unit-tests - `LOG_LEVEL` accepts zerolog values `panic`, `fatal`, `error`,`warn`,`info`,`debug`,`trace` and `''`. Values could be **case insensitive**, so `PANIC`, `Trace` are still valid values. If we don't set variable, then depresolver use `info` as default value. If `LOG_LEVEL` is invalid, depresolver returns an error so `main` can exit. - `LOG_FORMAT` saying how are log records printed. It accepts case insensitive values `['','json','simple']`. Default value `json`. In case of invalid value returns an error so `main` can exit. - `NO_COLOR` is bool value indicating colored input. Variable is useful only if `LOG_FORMAT` == simple. default value is true. Related to #331
8a4762e
to
f85c9e4
Compare
@somaritane amended |
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.
lgtm!
Code implements depresolver part - logger inputs
Input variables defines how will looger act.
LOG_FORMAT
,LOG_LEVEL
,NO_COLOR
LOG_LEVEL
accepts zerolog valuespanic
,fatal
,error
,warn
,info
,debug
,trace
and''
.Values could be case insensitive, so
PANIC
,Trace
are still valid values. If we don't set variable,then depresolver use
info
as default value. IfLOG_LEVEL
is invalid, depresolver returns an errorso
main
can exit.LOG_FORMAT
saying how are log records printed. It accepts case insensitive values['','json','simple']
.Default value
json
. In case of invalid value returns an error somain
can exit.NO_COLOR
is bool value indicating colored input. Variable is useful only ifLOG_FORMAT == simple
.default value is
true
.Related to #331