Skip to content

AddSerilog require a receiver ILoggingBuilder #87

Closed
@michaelsogos

Description

@michaelsogos

I'm following github pages to get started with serilog; but visual studio show me the error in subject.

Seems that .AddSerilog() is not available for interface ILoggerFactory, but it is for ILoggingBuilder

I'm building in .NET Core 2

a snippet of what i'm doing

  public static void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            var applicationLifetime = app.ApplicationServices.GetRequiredService<IApplicationLifetime>();
            applicationLifetime.ApplicationStopping.Register(OnShutdown);
            
            loggerFactory.AddSerilog();
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions