I’m using Serilog for writing to disk and Seq.
I’d like to log to both disk, seq and console simultaneously using a single line of code. E.g.
Log.Information("This is some task related query");
As suppose to:
Log.Information("This is some task related message"); context.WriteLine("This is some task related message");
I followed a guide on how to extend Serilog sink to include
Hangfire.Console logs too (This article here https://www.dennis-s.dk/2019-07/hangfire-console-serilog-sink). However, when Seq tries to serialise the PerformContext property, it throws an error.
could not be formatted into JSON for Seq and will be dropped: System.NotSupportedException: The value x is not of a type supported by this visitor.
Anyone had any experience in getting this behaviour? Or would you just separate the two? Thanks.