S
Simon Johnson
I'm having trouble creating a custom event log.
Here's my Code:
static void Main(string[] args)
{
if (!EventLog.SourceExists("OnlineTonnages"))
EventLog.CreateEventSource("OnlineTonnages","EWC
Applications",Environment.MachineName);
EventLog ApplicationLog = new EventLog();
ApplicationLog.Source = "OnlineTonnages";
ApplicationLog.MachineName = Environment.MachineName;
ApplicationLog.Log = "EWC Applications";
ApplicationLog.WriteEntry("Test!");
}
It compiles and runs without error.. However, when I check the Event Viewer
to see if my log contains the test message I find that although the log has
been created and appears in the Event Viewer the Events don't go against the
log. Instead they appear in the application log with the following message:
"The description for Event ID ( 0 ) in Source ( OnlineTonnages ) cannot be
found. The local computer may not have the necessary registry information or
message DLL files to display messages from a remote computer. You may be
able to use the /AUXSOURCE= flag to retrieve this description; see Help and
Support for details. The following information is part of the event: Test!"
Is this a bug in the framework or something i'm doing incorrectly?
Simon.
Here's my Code:
static void Main(string[] args)
{
if (!EventLog.SourceExists("OnlineTonnages"))
EventLog.CreateEventSource("OnlineTonnages","EWC
Applications",Environment.MachineName);
EventLog ApplicationLog = new EventLog();
ApplicationLog.Source = "OnlineTonnages";
ApplicationLog.MachineName = Environment.MachineName;
ApplicationLog.Log = "EWC Applications";
ApplicationLog.WriteEntry("Test!");
}
It compiles and runs without error.. However, when I check the Event Viewer
to see if my log contains the test message I find that although the log has
been created and appears in the Event Viewer the Events don't go against the
log. Instead they appear in the application log with the following message:
"The description for Event ID ( 0 ) in Source ( OnlineTonnages ) cannot be
found. The local computer may not have the necessary registry information or
message DLL files to display messages from a remote computer. You may be
able to use the /AUXSOURCE= flag to retrieve this description; see Help and
Support for details. The following information is part of the event: Test!"
Is this a bug in the framework or something i'm doing incorrectly?
Simon.