Determine if logevent will actually log (ShouldLog)

7 views
Skip to first unread message

Mark Olszowka

unread,
May 11, 2017, 10:19:45 PM5/11/17
to NLog-Users
Is there a way to check if a logevent will actually get logged (based on the current configuration) before calling the Log method?

I need to do some code before calling the Log method that will affect performance, so i only want to do it if i know it will actually get logged.

Enterprise Library has something called ShouldLog that is used for this specific purpose.  Is there something similar in NLog?

Reply all
Reply to author
Forward
0 new messages