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

tracing-subscriber: programmatically opt out of setting a global logger even when tracing-log is enabled #3074

Open
lcmgh opened this issue Sep 6, 2024 · 1 comment

Comments

@lcmgh
Copy link

lcmgh commented Sep 6, 2024

If one wants to opt-out of letting tracing-subscriber init. a global logger one has to disable the feature flag tracing-log.

There are setups when an app wants to decide by config whether a global logger should be set by tracing-subscriber. This can currently not be done because the setting must be configured on compile time.

Example scenarios that all should be configurable on runtime:

  • Custom logger + Tracing as OTLP Exporter
  • Tracing as logger AND OTLP exporter

To support both cases tracing-log must be set which then throws an error for the first scenario.

@lcmgh lcmgh changed the title tracing-subscriber: programmatically opt out of initialize a log compatibility layer.` tracing-subscriber: programmatically opt out of setting a global logger even when tracing-log is enabled Sep 6, 2024
@sdtnjung
Copy link

sdtnjung commented Sep 7, 2024

Workaround: Use tracing-subscriber with default-features = false and only initialize the log_tracer when really needed.

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

No branches or pull requests

2 participants