You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The logging exporter does not honor telemetry logs configuration, since a new logger is created at startup which is completely independent from the Collector's logger.
I expected logging exporter logs to be logged to the example.log file, as this is where the rest of components will log.
What did you see instead?
All logs but the logging exporter's are logged to example.log. The logging exporter logs are logged to stderr.
What version did you use?
Version: v0.55.0
Additional context
This also makes this exporter less useful on context where the Collector is used as a library, since you effectively can't control where the logging exporter outputs.
This can be easily fixed if we take the core from the main logger and build a new core with sampling options to it, using zapcore.NewSamplingWithOptions. The level can also be managed with zapcore.NewIncreaseLevelCore, although in this case we lose the possibility of having a lower log level on the logging exporter than in the global one (IMO that's fine so long as we have a descriptive error).
The text was updated successfully, but these errors were encountered:
Originally the logging exporter used to output using the default logger, this changed in #257. It seems like the reason was to have independent control; however we can keep roughly the same level of independent control while using the same logger by building from the same core.
…#5677)
Build the logger on the logging exporter's logger from the one on `TelemetrySettings`, so that the logger honors the configuration settings on `telemetry::logs` and the configuration options on `CollectorSettings.LoggingOptions`.
Depends on #5678
**Link to tracking Issue:** Fixes#5652
**Documentation:** Documented the feature gate.
Describe the bug
The logging exporter does not honor telemetry logs configuration, since a new logger is created at startup which is completely independent from the Collector's logger.
opentelemetry-collector/exporter/loggingexporter/factory.go
Line 87 in feab949
I am not sure if this was intentional, but it is confusing to me :)
Steps to reproduce
Run the Collector with the following configuration:
What did you expect to see?
I expected logging exporter logs to be logged to the
example.log
file, as this is where the rest of components will log.What did you see instead?
All logs but the logging exporter's are logged to
example.log
. The logging exporter logs are logged to stderr.What version did you use?
Version: v0.55.0
Additional context
This also makes this exporter less useful on context where the Collector is used as a library, since you effectively can't control where the logging exporter outputs.
This can be easily fixed if we take the core from the main logger and build a new core with sampling options to it, using
zapcore.NewSamplingWithOptions
. The level can also be managed withzapcore.NewIncreaseLevelCore
, although in this case we lose the possibility of having a lower log level on the logging exporter than in the global one (IMO that's fine so long as we have a descriptive error).The text was updated successfully, but these errors were encountered: