LogWriter Class

Instance based class to write log messages based on a given configuration. Messages are routed based on category.

Namespace:  Microsoft.Practices.EnterpriseLibrary.Logging
Assembly:  Microsoft.Practices.EnterpriseLibrary.Logging (in Microsoft.Practices.EnterpriseLibrary.Logging.dll)

Syntax

'Declaration
Public MustInherit Class LogWriter _
    Implements IDisposable
public abstract class LogWriter : IDisposable
public ref class LogWriter abstract : IDisposable
public abstract class LogWriter implements IDisposable

Remarks

To write log messages to the default configuration, use the Logger facade. Only create an instance of a LogWriter if you need to write log messages using a custom configuration.

The LogWriter works as an entry point to the System.Diagnostics trace listeners. It will trace the LogEntry through the Microsoft.Practices.EnterpriseLibrary.Logging.TraceListenerss associated with the LogSources for all the matching categories in the elements of the Categories property of the log entry. If the "all events" special log source is configured, the log entry will be traced through the log source regardles of other categories that might have matched. If the "all events" special log source is not configured and the "unprocessed categories" special log source is configured, and the category specified in the logEntry being logged is not defined, then the logEntry will be logged to the "unprocessed categories" special log source. If both the "all events" and "unprocessed categories" special log sources are not configured and the property LogWarningsWhenNoCategoriesMatch is set to true, then the logEntry is logged to the "logging errors and warnings" special log source.

Inheritance Hierarchy

System.Object
  Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter
    Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterImpl

See Also

LogWriter Members

Microsoft.Practices.EnterpriseLibrary.Logging Namespace