I'm trying to integrate serilog for global handling of exceptions, however when I try to add ILoggerFactory as new parameter to Configuration() the app doesn't load because it can't recognize the OWIN Startup.cs anymore. Can anyone tell if I'm missing something? Below is my Startup.cs:
using Microsoft.Extensions.Logging;
using Microsoft.Owin;
using Owin;
using Serilog;
[assembly: OwinStartupAttribute(typeof(InvoiceAutomation.WebUI.Startup))]
namespace InvoiceAutomation.WebUI
{
public partial class Startup
{
public Startup()
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.LiterateConsole()
.WriteTo.RollingFile("log-{Date}.txt")
.CreateLogger();
}
public void Configuration(IAppBuilder app, ILoggerFactory loggerFactory)
{
ConfigureAuth(app);
loggerFactory.AddSerilog();
}
}
}
app.Use<LoggingMiddleware>();
and removeloggerFactory
– Inoperable