Click or drag to resize
LoggingRule Class
Represents a logging rule. An equivalent of <logger /> configuration element.
Inheritance Hierarchy
SystemObject
  NLog.ConfigLoggingRule

Namespace: NLog.Config
Assembly: NLog (in NLog.dll) Version: 4.3.0
Syntax
public class LoggingRule

The LoggingRule type exposes the following members.

Constructors
  NameDescription
Public methodLoggingRule
Create an empty LoggingRule.
Public methodLoggingRule(String, Target)
Create a (disabled) LoggingRule. You should call EnableLoggingForLevel(LogLevel) or see cref="EnableLoggingForLevels"/> to enable logging.
Public methodLoggingRule(String, LogLevel, Target)
Create a new LoggingRule with a minLevel which writes to target.
Public methodLoggingRule(String, LogLevel, LogLevel, Target)
Create a new LoggingRule with a minLevel and maxLevel which writes to target.
Top
Properties
  NameDescription
Public propertyChildRules
Gets a collection of child rules to be evaluated when this rule matches.
Public propertyFilters
Gets a collection of filters to be checked before writing to targets.
Public propertyFinal
Gets or sets a value indicating whether to quit processing any further rule when this one matches.
Public propertyLevels
Gets the collection of log levels enabled by this rule.
Public propertyLoggerNamePattern
Gets or sets logger name pattern.
Public propertyTargets
Gets a collection of targets that should be written to when this rule matches.
Top
Methods
  NameDescription
Public methodDisableLoggingForLevel
Disables logging for a particular level.
Public methodEnableLoggingForLevel
Enables logging for a particular level.
Public methodEnableLoggingForLevels
Enables logging for a particular levels between (included) minLevel and maxLevel.
Public methodIsLoggingEnabledForLevel
Checks whether te particular log level is enabled for this rule.
Public methodNameMatches
Checks whether given name matches the logger name pattern.
Public methodToString
Returns a string representation of LoggingRule. Used for debugging.
(Overrides ObjectToString.)
Top
See Also