Skip to content

How to redirect log to Serilog #76

Open
@askids

Description

@askids

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions