Coder Social home page Coder Social logo

Comments (2)

nblumhardt avatar nblumhardt commented on August 19, 2024

Hi! Yes, working around this with AddProvider(new ...) is probably the way to go.

This is an unfortunate remnant of the original ".NET Core 2" iteration of this library, before we implemented the UseSerilog() (logger factory) method of integration. Back at that time, having two logging pipelines with level configuration both impacting the final result was problematic.

If I could go back in time :-), in "provider mode" I'd now avoid doing this, and just leave MEL's filters alone when using Serilog as a provider rather than as the complete logging pipeline.

Serilog 4 introduces a new public CreateSink() API that can instantiate any Serilog sink independently of the Serilog pipeline. I've been wondering whether this might be a good route to replacing the current provider mechanism with something based on e.g.:

host.Logging.AddSink(writeTo => writeTo.File(...));

Behind the scenes, this would use LoggerSinkConfiguration.CreateSink() to turn the argument into an ILogEventSink, and a SerilogSinkLoggerProvider would be wrapped around the result.

JSON configuration support is still a bit of an unknown, though, so needs some more investigation. Let's leave this ticket as the tracking issue.

from serilog-extensions-logging.

vars-ecco avatar vars-ecco commented on August 19, 2024

Hi, thanks for the response,

Let's leave this ticket as the tracking issue.

Ok, feel free to close when needed)

from serilog-extensions-logging.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.