 | LoggingConfigurationAddRuleForOneLevel Method (LogLevel, String, String) |
Add a rule for one loglevel.
Namespace:
NLog.Config
Assembly:
NLog (in NLog.dll) Version: 6.0.0+cfb73701cda54e2410b006f649f072e90daef707
Syntaxpublic void AddRuleForOneLevel(
LogLevel level,
string targetName,
string loggerNamePattern = "*"
)
Public Sub AddRuleForOneLevel (
level As LogLevel,
targetName As String,
Optional loggerNamePattern As String = "*"
)
Dim instance As LoggingConfiguration
Dim level As LogLevel
Dim targetName As String
Dim loggerNamePattern As String
instance.AddRuleForOneLevel(level, targetName,
loggerNamePattern)
member AddRuleForOneLevel :
level : LogLevel *
targetName : string *
?loggerNamePattern : string
(* Defaults:
let _loggerNamePattern = defaultArg loggerNamePattern "*"
*)
-> unit
Parameters
- level
- Type: NLogLogLevel
log level needed to trigger this rule. - targetName
- Type: SystemString
Name of the target to be written 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