1

On my WebUI project startUp.cs class i have

        public Startup()
    {
        Log.Logger = new LoggerConfiguration()
                   .WriteTo.Console()
                   .CreateLogger();
    }

and in my class library project sample.cs class i am calling

                Log.Logger.Information("This will be written to the rolling file set");

the both using serilog and class library has webUI reference but nothing happens.

Any ideas?

DisplayName
  • 71
  • 1
  • 7

1 Answers1

1

If the web app is running under IIS, you won't get output via the console. It's also likely that the app pool account IIS is using won't have access to many local paths. The trick here is usually finding a local path with valid permissions.

You can get additional diagnostics from Serilog's internal log: https://github.com/serilog/serilog/wiki/Debugging-and-Diagnostics

Nicholas Blumhardt
  • 30,271
  • 4
  • 90
  • 101