jaegertracing / jaeger-client-csharp

🛑 This library is DEPRECATED!
https://jaegertracing.io/
Apache License 2.0
302 stars 67 forks source link

Configurable log level for logging reporter #158

Closed gregbair closed 4 years ago

gregbair commented 5 years ago

Requirement - what kind of business use case are you trying to solve?

We are trying to reduce redundant logging in our services. While we could just turn off the logging reporter, it would make more sense for us to put the output from the Logging reporter on Debug or even Verbose.

Problem - what in Jaeger blocks you from solving the requirement?

The LoggingReporter is hard-coded to output at Information. -https://github.com/jaegertracing/jaeger-client-csharp/blob/master/src/Jaeger/Reporters/LoggingReporter.cs#L22

Proposal - what do you suggest to solve the problem or improve the existing situation?

Allow this to be configurable.

Any open questions to address

I'm not sure of any.

Falco20019 commented 5 years ago

Please have a look at https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/index?view=aspnetcore-2.2#log-filtering to see if configuring the ILoggerFactory would already solve your problem. You can set filters on a class full name and therefore also deactivate the log entries from this class. Or is it just about this one specific log entry level?

gregbair commented 5 years ago

It's about this one. I could use filtering to do this, but it does complicate configuration, as we would basically have to configure multiple services to say "Logging level information except this one class". That gets complex if we're doing it for multiple things (we already do this for ASP.NET logging, which is way too verbose at Information, but I digress).

We do provide a separate wrapping implementation of ILoggerFactory to the reporter. I'll see what I can do there. I'm trying to find a solution I can put in our base library that all our services use instead of having to rely on configuration.

I'd still consider this a feature request, but I understand if it's not "worth it" to the project.

Thanks!

joacar commented 4 years ago

Hi,

I experience the same issue with Jaeger client CSharp-0.3.6.0, the logs are written even though I've set the filtering level during configuration of logger:

"Logging": {
    "LogLevel": {
      "Microsoft": "Warning"      
    }
}

Still for the HTTP POST the Logs in categoryMicrosoft.AspNetCore are written:

event "Microsoft.AspNetCore.Mvc.BeforeOnAuthorization"
component "Microsoft.AspNetCore"
Falco20019 commented 4 years ago

@gregbair Sorry, I currently don’t have a lot of time for the project.

@joacar These entries should come from https://github.com/opentracing-contrib/csharp-netcore and not from here I think. Please check

joacar commented 4 years ago

@Falco20019 I'll check that repo, thanks for quick reply

gregbair commented 4 years ago

@Falco20019 I understand. I’ll close this as there are other methods to do this. Thanks!