Ads by Lake Quincy Media

Wiki Navigation

 
Gibraltar - Learn about the best analysis tool for NLog

WhenContains filter

NLog documentation is currently being re-organized to use the wiki format. Some content is still missing or incomplete.
We need volunteers to help maintain and organize this Wiki. Please contact Jarek if you are interested in helping out.

Matches when the calculated layout contains the specified substring. This filter is deprecated in favour of <when /> which is based on contitions. 

Supported in

Configuration Syntax

<rules>
  <logger ... >
    <whenContains layout="Layout" substring="String" action="Enum" ignoreCase="Boolean"/>
  </logger>
</rules>
Read more about using the Configuration File.

Parameters

  • Filtering Options
  • layout - Layout to be used to filter log messages.Layout Required.
  • substring - Substring to be matched. 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.
  • ignoreCase - Indicates whether to ignore case when comparing strings.Boolean Default: False

Fatal error: Call to undefined function ad_script_footer() in /home/jkowalski/nlog-project.org/wiki/skins/NLog.php on line 297