I'm trying to set up a simple logging configuration for my Windows service using Topshelf and Serilog (the Serilog.Extras.Topshelf package respectively).
HostLogger.UseLogger(new SerilogHostLoggerConfigurator(new LoggerConfiguration()
.WriteTo.RollingFile(AppDomain.CurrentDomain.BaseDirectory + "\\logs\\app-{Date}.log")
.WriteTo.ColoredConsole()
.MinimumLevel.Debug()
.CreateLogger()));
HostFactory.Run(x => {
x.UseSerilog();
...
The service runs fine, however no output is made, neither to the console nor the specified log file (I can see that one is being created but it remains empty). Has anyone experience using both frameworks?
x.UseSerilog
without theLoggerConfiguration
orILogger
parameter would use the global logger. – Carn