0
votes

We intend to introduce NLog in a C# application with multiple targets, including the common log file but also a target showing specific messages as popup (e.g. relevant warnings or errors).

Is there any possibility to add kind of a meta information when dropping the message to NLog, like a flag whether the messages is relevant for the user during execution apart from solely the log level?

In other words, there may be logs with level "Warning" which should be written in the log file, while others additionally should trigger opening a message box in the UI as well. The differentiation somehow needs to be made.

1

1 Answers

0
votes

There are several ways to add context information:

This information can be used in the filtering logic in the logging-rules: https://github.com/nlog/nlog/wiki/Filtering-log-messages