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

enable to choose logger when auto instrumentation and logback #13174

Open
tkmsaaaam opened this issue Feb 3, 2025 · 1 comment
Open

enable to choose logger when auto instrumentation and logback #13174

tkmsaaaam opened this issue Feb 3, 2025 · 1 comment
Labels
enhancement New feature or request needs triage New issue that requires triage

Comments

@tkmsaaaam
Copy link

Is your feature request related to a problem? Please describe.

I can not choose logger when using auto instrumentation and logback.

When it's setting like OTEL_LOGS_EXPORTER=otlp (default) and java -javaagent:/path/to/opentelemetry-javaagent.jar, all of loggers export to logging service (e.g. loki). So when I don't want to send some logs to loki (it depends on logger), I can't use auto instrumentation (especially log). I want to send only root logs to loki and I don't want to send SECURE logger. when below settings

<logger name="com.example" level="INFO"/>
<logger name="SECURE" level="INFO" additivity="false">  
    <appender-ref ref="SECURE_APPENDER"/>  
</logger>
<root level="INFO">  
    <appender-ref ref="STDOUT"/>  
    <appender-ref ref="FILE"/>  
</root>

Describe the solution you'd like

If I improve this repository, I make new options. like below
otel.instrumentation.logback.send-only-root-logger
otel.instrumentation.logback.chosen-loggers

Implement the decision whether or not to output based on the above options around the following


Describe alternatives you've considered

No response

Additional context

No response

@tkmsaaaam tkmsaaaam added enhancement New feature or request needs triage New issue that requires triage labels Feb 3, 2025
@trask
Copy link
Member

trask commented Feb 3, 2025

it should be possible to filter out specific logger names in the future, here's the recent spec work outlining the proposal: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/sdk.md#loggerconfigurator

in the meantime, you could disable the logback autoinstrumentation and use the logback appender directly which should give you more control

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage New issue that requires triage
Projects
None yet
Development

No branches or pull requests

2 participants