I am using ServiceStack 5.8.0 in a netcore3.1 ASP.NET project using the standard template.
Way down deep in my domain I am using ILogger
(Microsoft.Extensions.Logging) to do all my logging.
I have registered a console logger in the standard ASP.NET way (in Program.cs) for now for testing:
public static IWebHost BuildWebHost(string[] args)
{
return WebHost.CreateDefaultBuilder(args)
.UseModularStartup<Startup>()
.ConfigureLogging((context, builder) => builder.AddConsole())
.Build();
}
Now, my code uses that logger at runtime, but I also wanted ServiceStack to use that logger as well.
In AppHost.cs
, what should I be doing with LogManager.LogFactory
to force ServiceStack code to use the pre-defined logger from above? So that I only have to change my implementation of the logger in Program.cs
only?