I'm using Serlog 2.10, Writing to Console (as human-readable text), and to RollingFile - with JsonFormatter.
I want in the output JSON to have both: "Message" and "MessageTemplate" nodes,
However I'm getting only either "Message" or "MessageTemplate", but not both.
Here's how it's being configured:
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Information()
.WriteTo.Console()
.WriteTo.RollingFile(new JsonFormatter(), "logs/log-{Date}.log")
.CreateLogger();
I followed the instructions on this page: https://github.com/serilog/serilog-formatting-compact
I've tried all 3 Json Formatters:
- "RenderedCompactJsonFormatter" - puts "@m" (Message) in the output
- "CompactJsonFormatter" - puts "@mt" (MessageTemlate) in the output
- "JsonFormatter" - puts "MessageTemplate" in the output
How can I include both of them in the output?
Any assistance would be appreciated