How do you turn off the OpenTelementry INFO messages in Rails startup? #1165
-
When we turned on OpenTelemetry in our Rails 6/7 apps we started getting a bunch of INFO messages dumped to stdout. Nothing else in our Rails apps generates these types of messages and I can't seem to find a way to turn them off. They don't seem to obey the Rails.logger config settings. Is anyone else having this problem or is it just me? Am I missing some config somewhere that disables these INFO messages? Or is this a bug in OpenTelementry?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The most consistent way to control log verbosity for the OTel SDK is to use the You may also provide your own logger to the SDK Configurator during initialization2. E.g. OpenTelemetry::SDK.configure do |c|
c.logger = rails_configuration.logger
# custom configuration
end In this case the OTel logger will wrap your custom logger and send it messages at From there your logger will receive Footnotes |
Beta Was this translation helpful? Give feedback.
The most consistent way to control log verbosity for the OTel SDK is to use the
OTEL_LOG_LEVEL
environment variable, which is set toINFO
by default1.You may also provide your own logger to the SDK Configurator during initialization2.
E.g.
In this case the OTel logger will wrap your custom logger and send it messages at
info
level, unless you set the envar.From there your logger will receive
info
or higher.Footnotes
https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#general-sdk-configuration ↩
https://www.rubydoc.info/gems/opentelemetry-sdk/OpenT…