Mark,

What value do you want to set the EventID to? A single value for all
events? Different values?

Why do you want to set the EventID? Localization? Identification?
Support query info? or some other reason?


Some background. Microsoft has the following to say about event
identifiers:

"Event identifier. The value is specific to the event source for the
event, and is used with source name to locate a description string in
the message file for the event source."

And

"The event identifier together with source name and a language
identifier identify a string that describes the event in more detail.
The strings are used as replacement strings and are merged into the
message string to make a complete message. The message strings are
contained in a message file specified in the source entry in the
registry. To obtain the appropriate message string from the message
file, load the message file with the LoadLibrary function and use the
FormatMessage function."

There is a description of the event id format here
http://msdn.microsoft.com/library/en-us/debug/base/event_identifiers.asp


Having said that I haven't found a way of building localizable event log
messages into managed assembly, i.e. what the message compiler (mc) does
for C++. Under .NET 1.0 this used to cause a message to be prefixed on
the text displayed in the Event Viewer:

"The description for Event ID ( 1 ) in Source ( EventSource ) cannot be
found. The local computer may not have the necessary registry
information or message DLL files to display messages from a remote
computer."

This does not seem to happen under .NET 1.1.

Cheers,
Nicko


> -----Original Message-----
> From: Mark Richman [mailto:[EMAIL PROTECTED] 
> Sent: 31 January 2005 22:05
> To: [email protected]
> Subject: Setting EventID for EventLogAppender
> 
> How do I set the EventID for the EventLogAppender?
> 
>  
> 
> This is my config:
> 
>  
> 
> <appender name="EventLogAppender" 
> type="log4net.Appender.EventLogAppender" >
> 
>             <applicationName value="WAHP" />
> 
>             <layout type="log4net.Layout.PatternLayout">
> 
>                         <conversionPattern value="%d [%t] 
> %-5p %c [%x] - %m%n" />
> 
>             </layout>
> 
>   </appender>
> 
>  
> 
> I do not want to have to set the EventID value in my code. 
> Can it be autogenerated?
> 
> Mark A. Richman
> Sr. Programmer
> Affinity Internet, Inc.
> (954) 334-8203
> [EMAIL PROTECTED] 
> 
>  
> 
> 

Reply via email to