Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

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)

public abstract class LogWriter : IDisposable

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.

System.Object
  Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter
    Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterImpl
Show:
© 2015 Microsoft