.NET Framework Bookmark and Share   
 index > .NET Base Class Library > EventLog.WriteEntry - static or not?
 

EventLog.WriteEntry - static or not?

I am using the simplest way to write to the event log:
if(!EventLog.SourceExists(...)) {EventLog.CreateEventSource(...);}

EventLog.WriteEntry(...);


From the syntax, WriteEntry should be static, but in the documentation it is not.
I am interested to find out why because this code will be called from different threads and only the static
members of EventLog are thread-safe.


viliescu

Eventlog.WriteEntry has both static and non static members, check out http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdiagnosticseventlogclasswriteentrytopic4.asp

What overload in particular are you curious about?

Ariel Weinstein

Eventlog.WriteEntry has both static and non static members, check out http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdiagnosticseventlogclasswriteentrytopic4.asp

What overload in particular are you curious about?

Ariel Weinstein

Thank you ... I have read the documentation before but I think I was confusing one of the non-static versions with a static one. Now everything is clear.

viliescu

You can use google to search for other answers

Custom Search

More Threads

• how to copy dataset to datatable
• Call overloaded constructor !!
• Enumeration in .NET 1.1 and 2.0
• How can I normalice all white space in a string??
• adding to a list from a List...
• Salted Hash - Saving Salt inside password?!
• Disable copy paste to secure application
• insert statement error
• how to copy excel file from any drive or from any network drive to a desired folder on my computer
• Problem publishing project with ClikOnce