I am using Serilog within an TopShelf Service, logging to the console and a rolling file. When running the service in a console my messages are written to the logfile, but when I install the service and run it no logging occurs. Is there anything special I need to configure? The file is written to the binaries folder under ".\logs\log-{date}.txt".
Best regards Gope
I had a very similar issue. In my case the problem was with relative paths. I just had to specify absolute path. Now it works like a charm.
WriteTo.RollingFile(AppDomain.CurrentDomain.BaseDirectory + "\\logs\\log-{Date}.log")
Hope it helps!