Skip to content
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 log_level configuration #121

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

codeboten
Copy link
Contributor

This is to support the env variable OTEL_LOG_LEVEL.

Fixes #120

This is to support the env variable OTEL_LOG_LEVEL.

Fixes open-telemetry#120

Signed-off-by: Alex Boten <[email protected]>
@codeboten codeboten requested a review from a team September 16, 2024 17:12
@marcalff
Copy link
Member

Related:

Until the spec defines an enum for log levels, opentelemetry-configuration can only represent a log level as a string, to be interpreted (differently) by each SDK implementation.

Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

This is the best we can do now, because the spec does not define an enum for log levels.

@@ -11,6 +11,9 @@
"disabled": {
"type": ["boolean", "null"]
},
"log_level": {
"type": ["string", "null"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, though without a resolution on open-telemetry/opentelemetry-specification#2039, we may be jumping ahead of the spec

examples/kitchen-sink.yaml Outdated Show resolved Hide resolved
@codeboten codeboten requested a review from a team as a code owner September 19, 2024 16:41
Copy link
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use the OTEL_LOG_LEVEL property in opentelemetry-java. For internal SDK logging, we use java util logging (or JUL for short), which comes with a default log level already, and has standard options for changing the log level on a per-library basis. For us, introducing an additional option would only muddy the log configuration story for users.

Therefore, I'm not a good judge of this property of its value since to me from the perspective of a java maintainer, it seems like a mistake. I won't approve, but also won't block progress.

@codeboten
Copy link
Contributor Author

For internal SDK logging, we use java util logging (or JUL for short), which comes with a default log level already, and has standard options for changing the log level on a per-library basis. For us, introducing an additional option would only muddy the log configuration story for users.

I would expect this property to be used in configuring JUL in the java implementation, would that not be the case? Is there an alternative configuration property available to end users through the configuration file?

@jack-berg
Copy link
Member

I would expect this property to be used in configuring JUL in the java implementation, would that not be the case? Is there an alternative configuration property available to end users through the configuration file?

I mean we'd have to have a discussion about it in the java SIG but my given that we've gone this long without supporting OTEL_LOG_LEVEL, I believe we'd skip support for this property under the same reasoning.

Is there an alternative configuration property available to end users through the configuration file?

No. Different tools for different things. The logging ecosystem in java is fractured and to complicated to explain here, but essentially users are used to the idea that they configure the logs from their libraries / frameworks in particular way. If we add support for this property, then there's the question of priority - should / can this property override the user's separate log config? A search for OTEL_LOG_LEVEL in opentelemetry-java doesn't indicate that there's been much discussion on this topic, the opinion I'm expressing here is worth revisiting. But its also noteworthy that we're this far into the of opentelemetry-java, and haven't heard much demand for OTEL_LOG_LEVEL.

@codeboten
Copy link
Contributor Author

A quick search through the OpenTelemetry github org https://github.com/search?q=org%3Aopen-telemetry%20OTEL_LOG_LEVEL&type=code shows that it's used in a few different SIGs, so it probably makes sense to move forward with it.

@brettmc can you review as it looks like PHP is one of the users of this env variable

@brettmc
Copy link
Contributor

brettmc commented Oct 14, 2024

can you review as it looks like PHP is one of the users of this env variable

@codeboten sorry I'm late with the review, but the proposed usage would work for PHP's requirements for log level. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add log level property to schema
5 participants