logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Grabowski <rongrabow...@yahoo.com>
Subject Re: log4net event logging appender
Date Thu, 19 Feb 2009 04:13:50 GMT
When you run your program as a normal user can you write to the EventLog without using log4net?

----- Original Message ----
From: rodchar <rodchar@hotmail.com>
To: log4net-dev@logging.apache.org
Sent: Wednesday, February 18, 2009 4:45:22 PM
Subject: log4net event logging appender

http://www.nabble.com/file/p22088962/log4tester.PNG log4tester.PNG 

hi all,

i have the simplest console app to test the eventlog appender.

http://www25.brinkster.com/rodchar/log4net.htm image of windiff 

Initially, if i run the app as a user the event log won't work. However, if
i run the app as an admin, it successfully writes to the event log. Then
when i run the app again as a user it will log to the event log (unlike
before). can someone please explain this?

Console Messages: 

************* Run As User *****************************
log4net:ERROR DOMConfigurator: Could not create Appender [EventLogAppender]
of t
ype [log4net.Appender.EventLogAppender]. Reported error follows.
System.Security.SecurityException: The source was not found, but some or all
nt logs could not be searched.  Inaccessible logs: Security.
   at System.Diagnostics.EventLog.FindSourceRegistration(String source,
String m
achineName, Boolean readOnly)
   at System.Diagnostics.EventLog.SourceExists(String source, String
   at System.Diagnostics.EventLog.SourceExists(String source)
   at log4net.Appender.EventLogAppender.ActivateOptions()
ment appenderElement)
The Zone of the assembly that failed was:
log4net:ERROR DOMConfigurator: Appender named [EventLogAppender] not found.

************* Run As Admin *****************************
log4net: EventLogAppender: Creating event source Source [log4netTester.exe]
in l
og Application]
log4net: EventLogAppender: Source [log4netTester.exe] is registered to log
log4net: DOMConfigurator: Created Appender [EventLogAppender]
log4net: DOMConfigurator: Adding appender named [EventLogAppender] to logger

View this message in context: http://www.nabble.com/log4net-event-logging-appender-tp22088962p22088962.html
Sent from the Log4net - Dev mailing list archive at Nabble.com.

View raw message