Hi,
is there some way how to use structured logs with TopSelf (I'm using serilog).
If I start application it logs ok, but when I start app as service. There are only messages from topshelf not from my service.
I found some examples like this:
public class VZPService
{
readonly Timer _timer;
private static readonly LogWriter Log = HostLogger.Get<VZPService>();
public VZPService()
{
_timer = new Timer(1000) {AutoReset = true};
_timer.Elapsed += (sender, eventArgs) => Log.InfoFormat("It is {Time} and all is well", DateTime.Now);
}
.....
But this Log.Info, Log.InfoFormat does not create structured logs it only logs string messages.
The only solution is create Serilog logger inside my class to use it?
Thank you Ales.