-
Notifications
You must be signed in to change notification settings - Fork 0
Eventlog target
Writes log message to the Event Log.
Supported in .NET and Mono ##Configuration Syntax
<targets>
<target xsi:type="EventLog"
name="String"
layout="Layout"
machineName="String"
source="String"
category="Layout"
eventId="Layout"
log="String" />
</targets>
Read more about using the [Configuration File](Configuration file).
##Parameters
###General Options
name - Name of the target.
###Layout Options
layout - Layout used to format log messages. Layout Required. Default: ${longdate}|${level:uppercase=true}|${logger}|${message}
###Event Log Options
machineName - Name of the machine on which Event Log service is running. Default: .
source - Value to be used as the event Source. By default this is the friendly name of the current AppDomain.
category - Layout that renders event Category. The categories must be predefined for the specified source and needs to be numeric. Layout
eventId - Layout that renders event ID. Layout
log - Name of the Event Log to write to. This can be System, Application or any user-defined name. Default: Application
##Example
<target xsi:type="EventLog"
name="eventlog"
source="${appName}"
layout="${message}${newline}${exception:format=ToString}"/>
- Search in documentation
- Getting started
- Examples
- External articles and tutorials
- FAQ
- Platform support
- Advanced Configuration file options
- Filtering log messages
- [Using Time Sources](Time Source)
- Visual Studio support
- Who is using NLog
- [Write custom extensions](Extending NLog)