Not logging in application log
-
Hi, I'm developing an asp.net application which logs error in case of exceptions. When it logs error teh following message displayed in event log. Error loading an Event Sink of type 'Microsoft.EnterpriseInstrumentation.EventSinks.LogEventSink'. The Event Source of name 'Application' will not write events out to this Event Sink. The following exception was returned during the load: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: An error occurred determining if the Windows Event Log source of Application (Loan) exists on machine .. This may be due to an incorrect machineName parameter. ---> System.Security.SecurityException: Requested registry access is not allowed. at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) at System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly) at System.Diagnostics.EventLog.SourceExists(String source, String machineName) at Microsoft.EnterpriseInstrumentation.EventSinks.LogEventSink..ctor(IDictionary parameters, EventSource eventSource) --- End of inner exception stack trace --- at Microsoft.EnterpriseInstrumentation.EventSinks.LogEventSink..ctor(IDictionary parameters, EventSource eventSource) --- End of inner exception stack trace --- at System.Reflection.RuntimeConstructorInfo.InternalInvoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at Microsoft.EnterpriseInstrumentation.EventSinks.EventSink.CreateNewEventSinks(DataRow[] eventSinkRows, EventSource eventSource) Can you please help me in this. thanks in advance Priya
-
Hi, I'm developing an asp.net application which logs error in case of exceptions. When it logs error teh following message displayed in event log. Error loading an Event Sink of type 'Microsoft.EnterpriseInstrumentation.EventSinks.LogEventSink'. The Event Source of name 'Application' will not write events out to this Event Sink. The following exception was returned during the load: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: An error occurred determining if the Windows Event Log source of Application (Loan) exists on machine .. This may be due to an incorrect machineName parameter. ---> System.Security.SecurityException: Requested registry access is not allowed. at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) at System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly) at System.Diagnostics.EventLog.SourceExists(String source, String machineName) at Microsoft.EnterpriseInstrumentation.EventSinks.LogEventSink..ctor(IDictionary parameters, EventSource eventSource) --- End of inner exception stack trace --- at Microsoft.EnterpriseInstrumentation.EventSinks.LogEventSink..ctor(IDictionary parameters, EventSource eventSource) --- End of inner exception stack trace --- at System.Reflection.RuntimeConstructorInfo.InternalInvoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at Microsoft.EnterpriseInstrumentation.EventSinks.EventSink.CreateNewEventSinks(DataRow[] eventSinkRows, EventSource eventSource) Can you please help me in this. thanks in advance Priya
I have had this problem using the Enterprise Library... it a matter of rigths over the register... if you do it with a win application ( just for testing ) you'll see that no error is written in the Event Log... because the Win Applications runs with the Credentials of the user is logged in the machine... but the ASP.NET user doesn't have this rigths... you have to give the ASP.NET user rigths to write in the Event Log. Regards Ricardo Casquete