I'm trying to write a log with Nlog into Eventlog, this a example of my Nlog.config
<target xsi:type="EventLog"
name="eventlog"
layout="${message}"
log="Application"
source="MyAppName" />
When executing InstallNlogConfig
with Administrator rigths this show this error:
NLog.NLogConfigurationException: Error during initialization of EventLog Target[eventlog] - System.IO.IOException: The network path was not found.
en Microsoft.Win32.RegistryKey.Win32ErrorStatic(Int32 errorCode, String str) en Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(RegistryHive hKey, String machineName, RegistryView view) en System.Diagnostics.EventLog.GetEventLogRegKey(String machine, Boolean writable) en System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly, Boolean wantToCreate) en System.Diagnostics.EventLog._InternalLogNameFromSourceName(String source, String machineName) en System.Diagnostics.EventLog.LogNameFromSourceName(String source, String machineName) en NLog.Targets.EventLogTarget.InitializeTarget() en c:\NLogBuild\src\NLog\Targets\EventLogTarget.cs:línea 175 en NLog.Targets.Target.Initialize(LoggingConfiguration configuration) en c:\NLogBuild\src\NLog\Targets\Target.cs:línea 288. 2013-06-10 12:21:05.0708 Info Shutting down logging... 2013-06-10 12:21:05.0708 Info Logger has been shut down.