-
Notifications
You must be signed in to change notification settings - Fork 89
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
Add support to custom log level through command line flag and environment variable #842
Conversation
@vitorhugoro1 Do you plan on changing the level of the log line I mentioned in the issue?
|
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.
Shouldn't we support setting via OTEL_LOG_LEVEL
env var?
That is tracked in #691. It is out of scope for this PR. |
This PR says
|
Yeah this PR will implement this change too, I take the approach just with flags because is the way I usually use log levels on container |
I changed some log level, not just in the line you mentioned but in another which is more suitable to debugging not exactly on a production setup. Changed the sample job too to use debug level by default |
Added the supporting via environment with the name you suggest |
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!
@vitorhugoro1 bump 😄 |
…withLogLevel method
Sorry for the late guys, applied the changes @MrAlias suggested and rebase with the main branch |
@MrAlias can you please have another look? |
@MrAlias can you review again, please? |
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.
🚀
Added on
InstrumentationOption
the option to define log level.Implemented a custom severity enum, called level.go, with options to set log levels based on text using
zap.Level
as reference.Added on CLI the flag
-log-level
that accept one ofLogLevel
value, which can be see on level.go ex.otel-go-instrumentation -log-level error
, the default value isinfo
.Added support to
OTEL_LOG_LEVEL
which implementsLogLevel
to set visibility level through environment variable.Changed multiples logs level to Debug to improve setup when using in production environment.
Closes Add log verbosity configuration and move the log in controller.go to debug level #691