Closed Marusyk closed 5 years ago
I assume this should be the same problem as in #146 that you mixed up the order of registering the Singleton and calling services.AddOpenTracing();
I think it has the wrong order in our example since we do not rely on setting configuring the logger factory. But I will look into it tomorrow in more detail and fix the examples if that‘s the case. Only had time now to look a bit into the code without testing too much today, sorry.
I had a look at your example. All the logs that you mention belong to OpenTracing.Contrib.NetCore
and are not related to ILogger
or even Jaeger
itself. They are created for you, because you enabled them by calling services.AddOpenTracing()
. So your request at https://github.com/opentracing-contrib/csharp-netcore/issues/42 is the correct place.
It looks like you are missunderstanding Jaeger
oder OpenTracing
as just a logging sink. https://github.com/opentracing-contrib/csharp-netcore is adding an ILoggerProvider
to write ILogger
logs to the currently active span. This provider is added to your ILoggerFactory
using the AddOpenTracing()
call. But those entries are not the only ones that OpenTracing.Contrib.NetCore
is generating. And those are not tied to the logging framework and therefore also not looking into the filters of the logging framework. To select what instrumentation you are interested in, you will have to configure the logging scope. Looking at https://github.com/opentracing-contrib/csharp-netcore/blob/master/samples/FrontendWeb/appsettings.json it seems, that you can do this also through the appsettings.json
. But since we are not the maintainers, I can't tell you any more details. here.
Let's say I have the following appsettings:
Then my configuration:
I have specified minimum log level to Error. But at the end I got many other logs. How can I configure that?
Actually I need only error logs (or maybe warnings too) but I got a lot of logs that I do not need. When I use Serilog it don't write any custom logs.