I am trying to port an existing console app written in .Net FW 4.7 to .Net Core. Previously, we were simply using Console.Writeline to write everything for logging purpose. But now, for logging, I am using Serilog with Console sink with structured json compact formatter.
When I use ArgsClass.ShowUsage() method to show available arguments, it writes to console, but in raw format and not in expected json format. Is there a way to route the ShowUsage() method output to Serilog so that it can then write it using required format.
hi,
I am trying to port an existing console app written in .Net FW 4.7 to .Net Core. Previously, we were simply using Console.Writeline to write everything for logging purpose. But now, for logging, I am using Serilog with Console sink with structured json compact formatter.
When I use ArgsClass.ShowUsage() method to show available arguments, it writes to console, but in raw format and not in expected json format. Is there a way to route the ShowUsage() method output to Serilog so that it can then write it using required format.
Thanks!