XmlConfigurator ConfigureAndWatch Method (ILoggerRepository, FileInfo) | Apache log4net™ SDK Documentation

Configures the ILoggerRepository using the file specified, monitors the file for changes and reloads the configuration if a change is detected.

Namespace: log4net.Config
Assembly: log4net (in log4net.dll) Version: 2.0.8.0-.NET 4.0
Syntax

C#
VB
C++
F#
Copy

    public static ICollection ConfigureAndWatch(
    	ILoggerRepository repository,
    	FileInfo configFile
    )

    Public Shared Function ConfigureAndWatch (
    	repository As ILoggerRepository,
    	configFile As FileInfo
    ) As ICollection

    public:
    static ICollection^ ConfigureAndWatch(
    	ILoggerRepository^ repository,
    	FileInfo^ configFile
    )

    static member ConfigureAndWatch :
            repository : ILoggerRepository *
            configFile : FileInfo -> ICollection

#### Parameters

repository
  Type: log4net.Repository
  ILoggerRepository
  The repository to configure.
configFile
  Type: System.IO
  FileInfo
  The XML file to load the configuration from.

#### Return Value

Type: ICollection

[Missing <returns> documentation for "M:log4net.Config.XmlConfigurator.ConfigureAndWatch(log4net.Repository.ILoggerRepository,System.IO.FileInfo)"]

Remarks

The configuration file must be valid XML. It must contain at least one element called log4net that holds the configuration data.

The configuration file will be monitored using a FileSystemWatcher and depends on the behavior of that class.

For more information on how to configure log4net using a separate configuration file, see [M:Configure(FileInfo)].

See Also

#### Reference

XmlConfigurator Class
ConfigureAndWatch Overload
log4net.Config Namespace
[M:Configure(FileInfo)]