I'm currently working on a custom installer, and a lot of my company's softwares use a specific log format (and we have a lot of tools to analyse them) but all of their programs are written in Delphi and the project i'm working on use C# so i can't reuse directly the library.
So i'm trying to format the NLog's output to fit our format while still having a "standard" output and being able to output the logs directly in a WPF control.
We have all the usual log level (debug, info, warning, error, ...) but we also have deepness mechanism. Basically we can have things like:
Time Deepness Message Warning Error
[TIME] 1 Hey 0 0
[TIME] 1 Some logs 0 0
[TIME] 2 ... 0 1
[TIME] 1 . 0 0
Take a look at the Mapped Diagnostics Context layout renderer. It lets you add contextual information that flows along with your code. Very useful.
Use the Mapped Diagnostics Context when you have information that you want available to every logger executing on the current thread. As the Mapped Diagnostics Context is thread-local, you must configure all properties within the context of each thread where the property value is required.
Then in the log config: