Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Log level per exporter? #5766

Closed
gintarasd-bentley opened this issue Jul 30, 2024 · 2 comments
Closed

Log level per exporter? #5766

gintarasd-bentley opened this issue Jul 30, 2024 · 2 comments
Labels
question Further information is requested

Comments

@gintarasd-bentley
Copy link

gintarasd-bentley commented Jul 30, 2024

What is the question?

Hello, is there a way to configure log levels per exporter?

Additional context

We want to send:

  • All logs to destination A
  • Error only logs to destination B

For ASP.NET Logging -> Logging provider, log levels can be configured like so:

{
  "Logging": {
    "ProviderA": {
      "LogLevel": {
        "Default": "Information"
      }
    },
    "ProviderB": {
      "LogLevel": {
        "Default": "Error"
      }
    }
  }
}

For OpenTelemetry logging provider -> Exporter however, I could not find anything similar.

@gintarasd-bentley gintarasd-bentley added the question Further information is requested label Jul 30, 2024
@cijothomas
Copy link
Member

Not easily possible. ILogger filtering mechanism is per provider. Entire OpenTelemetry is one provider from ILogger perspective. Further filtering is possible in OpenTelemetry, by wrapping exporting processors with a custom FilteringProcessor.
There are no examples on how to do that today.

You may take a look at the example from here: Azure/azure-sdk-for-net#44745 (comment) (and potentially contribute it back to the contrib repo, if you have bandwidth!).

There was a proposal to make this easier #5282 but that did not proceed much.

@gintarasd-bentley
Copy link
Author

Azure monitor is one of the exporters we were having trouble with, ended up using the old appinsights sdk so we have a separate configurable logging provider, thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants