Click or drag to resize
LoggingConfigurationAddRule Method (LogLevel, LogLevel, Target, String)
Add a rule with min- and maxLevel.

Namespace: NLog.Config
Assembly: NLog (in NLog.dll) Version: 4.3.0
Syntax
public void AddRule(
	LogLevel minLevel,
	LogLevel maxLevel,
	Target target,
	string loggerNamePattern = "*"
)

Parameters

minLevel
Type: NLogLogLevel
Minimum log level needed to trigger this rule.
maxLevel
Type: NLogLogLevel
Maximum log level needed to trigger this rule.
target
Type: NLog.TargetsTarget
Target to be written to when the rule matches.
loggerNamePattern (Optional)
Type: SystemString
Logger name pattern. It may include the '*' wildcard at the beginning, at the end or at both ends.
See Also