-
Notifications
You must be signed in to change notification settings - Fork 49
No reasonable way to use OTEL_LOG_LEVEL
#102
Comments
I was surprised when I set |
@MSNev what do you think? I agree that our current logging situation is not ideal and would like to make it easier to enable debugging. |
Agree, from (vague) memory this is why I had it before. So
Yes
Yes
Yes |
@MSNev or @longility would you like to make a PR? |
If I have time next week, I'll let you know. @MSNev feel free to take it you got time. |
I don't currently have cycles and I'm going to be OOF again in a few weeks, so go for it. |
If the logger is not set, should we be defaulting to a noop logger or |
Another option could be if env var |
Seems a reasonable compromise |
Acceptance criteria for whoever ends up tackling. I may have time next week.
|
I'm actually trying to figure out where this should go as Basically, without otel configuration and only env var Personally, this is the only acceptance criteria that I desire among the others and it may be the 80% case. I think the other acceptance criterias are 20% case. |
I tried for the longest time to make api.diag.setLogger(new DiagConsoleLogger(), getEnv().OTEL_LOG_LEVEL); |
Moved this to the main repo where the API now resides open-telemetry/opentelemetry-js#3312 |
Problem 1: just setting the logger uses a default level instead of the one from env configuration (https://github.com/open-telemetry/opentelemetry-js-api/blob/main/src/api/diag.ts#L75). Which means when setting a logger you need to fetch the ENV variable by yourself
which sort of defeats the point of the ENV variable?
Problem 2: tangentially, after
setLogLevel
was removed, there's no way to set the level and the logger independently (#9), which will make integration with Node ENV configuration tricky.I'd propose:
setLogLevel
setLogger
so that second argument, unless provided, doesn't change the log levelsetLogLevel
andsetLogger
to be called in any orderAlso, I'm happy to hear your thoughts, and send a PR when a resolution is decided.
ping @dyladan
The text was updated successfully, but these errors were encountered: