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: 5.3.4+73d83d3161d31288ca5c554cc50d27b6bed5f28b
Syntax
public class LoggingRule

The LoggingRule type exposes the following members.

Constructors
  NameDescription
Public methodLoggingRule
Create an empty LoggingRule.
Public methodLoggingRule(String)
Create an empty LoggingRule.
Public methodLoggingRule(String, Target)
Create a (disabled) LoggingRule. You should call EnableLoggingForLevel(LogLevel) or EnableLoggingForLevels(LogLevel, LogLevel) 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 propertyFilterDefaultAction
Default action if none of the filters match
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 following rules when this one matches.
Public propertyFinalMinLevel
Gets or sets the LogLevel whether to quit processing any following rules when lower severity and this one matches.
Public propertyLevels
Gets the collection of log levels enabled by this rule.
Public propertyLoggerNamePattern
Gets or sets logger name pattern.
Public propertyRuleName
Rule identifier to allow rule lookup
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 methodDisableLoggingForLevels
Disables logging for particular levels between (included) minLevel and maxLevel.
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 the particular log level is enabled for this rule.
Public methodNameMatches
Checks whether given name matches the LoggerNamePattern.
Public methodSetLoggingLevels
Enables logging the levels between (included) minLevel and maxLevel. All the other levels will be disabled.
Public methodToString
Returns a string representation of LoggingRule. Used for debugging.
(Overrides ObjectToString.)
Top
See Also