Skip to content

UseSerilog implementation #163

Closed
Closed
@dazinator

Description

@dazinator

Hello it's me again!

I couldn't use UseSerilog() in my application for reasons delved into here (my application is complex using autofac and child containers, and my own library for multitenancy) - and my workaround was to do this instead:

               webhostBuilder.ConfigureLogging((logging) =>
                {
                    logging.ClearProviders();// clears microsoft providers registered by default like console.
                    logging.AddSerilog(Logger);
                });

Which works. I raise this here because I thought maybe you could simplify the UseSerilog() implementation to call this method on the host builder instead, and then you could ditch your custom ILoggerFactory ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions