Click or drag to resize

LoggingConfiguration Class

Keeps logging configuration and provides simple API to modify it.
Inheritance Hierarchy
SystemObject
  NLog.ConfigLoggingConfiguration
    NLog.ConfigLoggingConfigurationParser

Namespace:  NLog.Config
Assembly:  NLog (in NLog.dll) Version: 5.3.4+73d83d3161d31288ca5c554cc50d27b6bed5f28b
Syntax
public class LoggingConfiguration

The LoggingConfiguration type exposes the following members.

Constructors
  NameDescription
Public methodLoggingConfiguration
Initializes a new instance of the LoggingConfiguration class.
Public methodLoggingConfiguration(LogFactory)
Initializes a new instance of the LoggingConfiguration class.
Top
Properties
  NameDescription
Public propertyAllTargets
Gets all targets.
Public propertyConfiguredNamedTargets
Gets a collection of named targets specified in the configuration.
Public propertyDefaultCultureInfo
Gets or sets the default culture info to use as FormatProvider.
Public propertyFileNamesToWatch
Gets the collection of file names which should be watched for changes by NLog.
Public propertyLogFactory
Gets the factory that will be configured
Public propertyLoggingRules
Gets the collection of logging rules.
Public propertyVariables
Gets the variables defined in the configuration or assigned from API
Top
Methods
  NameDescription
Public methodAddRule(LoggingRule)
Add a rule object.
Public methodAddRule(LogLevel, LogLevel, Target, String)
Add a rule with min- and maxLevel.
Public methodAddRule(LogLevel, LogLevel, String, String)
Add a rule with min- and maxLevel.
Public methodAddRule(LogLevel, LogLevel, Target, String, Boolean)
Add a rule with min- and maxLevel.
Public methodAddRuleForAllLevels(String, String)
Add a rule for all loglevels.
Public methodAddRuleForAllLevels(Target, String)
Add a rule for all loglevels.
Public methodAddRuleForAllLevels(Target, String, Boolean)
Add a rule for all loglevels.
Public methodAddRuleForOneLevel(LogLevel, Target, String)
Add a rule for one loglevel.
Public methodAddRuleForOneLevel(LogLevel, String, String)
Add a rule for one loglevel.
Public methodAddRuleForOneLevel(LogLevel, Target, String, Boolean)
Add a rule for one loglevel.
Public methodAddTarget(Target)
Registers the specified target object. The name of the target is read from Name.
Public methodAddTarget(String, Target)
Registers the specified target object under a given name.
Public methodFindRuleByName
Lookup the logging rule with matching RuleName
Public methodFindTargetByName(String)
Finds the target with the specified name.
Public methodFindTargetByNameTTarget(String)
Finds the target with the specified name and specified type.
Public methodInstall
Installs target-specific objects on current system.
Protected methodOnConfigurationAssigned
Notify the configuration when Configuration has been assigned / unassigned.
Protected methodPrepareForReload
Allow this new configuration to capture state from the old configuration
Public methodReload
Called by LogManager when one of the log configuration files changes.
Public methodRemoveRuleByName
Removes the specified named logging rule with matching RuleName
Public methodRemoveTarget
Removes the specified named target.
Public methodToString
Returns a string that represents the current object.
(Overrides ObjectToString.)
Public methodUninstall
Uninstalls target-specific objects from current system.
Top
Remarks
This class is thread-safe..ToList() is used for that purpose.
See Also