logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rodchar <rodc...@hotmail.com>
Subject log4net event logging appender
Date Wed, 18 Feb 2009 21:45:22 GMT

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
eve
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
machineName
)
   at System.Diagnostics.EventLog.SourceExists(String source)
   at log4net.Appender.EventLogAppender.ActivateOptions()
   at
log4net.Repository.Hierarchy.DOMHierarchyConfigurator.ParseAppender(XmlEle
ment appenderElement)
The Zone of the assembly that failed was:
MyComputer
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
[Appl
ication]
log4net: DOMConfigurator: Created Appender [EventLogAppender]
log4net: DOMConfigurator: Adding appender named [EventLogAppender] to logger
[ro
ot].


thanks,
rodchar
-- 
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.


Mime
View raw message