Ads by Lake Quincy Media

Wiki Navigation

 
Gibraltar - Learn about the best analysis tool for NLog

When filter

NLog documentation is a Wiki, which allows registered users to edit its content.
If you want to contribute, please create a user account and contact Jarek to get edit access.

Matches when the specified condition is met. 

Supported in

Configuration Syntax

<rules>
  <logger ... >
    <when condition="Condition" action="Enum"/>
  </logger>
</rules>
Read more about using the Configuration File.

Parameters

  • Filtering Options
  • condition - Condition expression.Condition Required.
  • action - Action to be taken when filter matches. Required.
    Possible values:
    • Ignore - The message should not be logged.
    • IgnoreFinal - The message should not be logged and processing should be finished.
    • Log - The message should be logged.
    • LogFinal - The message should be logged and processing should be finished.
    • Neutral - The filter doesn't want to decide whether to log or discard the message.

Remarks

Conditions are expressed using a simple language described here.