Skip to content

How do you turn off the OpenTelementry INFO messages in Rails startup? #1165

Answered by arielvalentin
rnhurt asked this question in Q&A
Discussion options

You must be logged in to vote

The most consistent way to control log verbosity for the OTel SDK is to use the OTEL_LOG_LEVEL environment variable, which is set to INFO by default1.

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 info level, unless you set the envar.

From there your logger will receive info or higher.

Footnotes

  1. https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#general-sdk-configuration

  2. https://www.rubydoc.info/gems/opentelemetry-sdk/OpenT…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@rnhurt
Comment options

@robbkidd
Comment options

Answer selected by rnhurt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants