D
djouungk
I created a custom event log. I can write to it without any problems.
When I look at it in the event viewer, I see that the custom event log
copied the system log and If I clear out the custom one it clears out
the system log. Is this supposed to happen?
I don't want anything fancy, just to write text messages to this log.
I am also getting in the system log:
"The description for Event ID ( 0 ) in Source ( EventLogTry ) 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 Message Written."
Here is my code:
public Form1() {
InitializeComponent();
checkLog();
}
private void checkLog() {
if (!EventLog.SourceExists("EventLogTry")) {
EventSourceCreationData d = new
EventSourceCreationData("EventLogTry","myEventLog");
EventLog.CreateEventSource(d);
}
}
private void btnCreateLog_Click(object sender, EventArgs e) {
if (this.txtLogName.Text.Length != 0) {
myEventLog.WriteEntry("Test Message Written.");
}
}
TIA,
Doug
When I look at it in the event viewer, I see that the custom event log
copied the system log and If I clear out the custom one it clears out
the system log. Is this supposed to happen?
I don't want anything fancy, just to write text messages to this log.
I am also getting in the system log:
"The description for Event ID ( 0 ) in Source ( EventLogTry ) 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 Message Written."
Here is my code:
public Form1() {
InitializeComponent();
checkLog();
}
private void checkLog() {
if (!EventLog.SourceExists("EventLogTry")) {
EventSourceCreationData d = new
EventSourceCreationData("EventLogTry","myEventLog");
EventLog.CreateEventSource(d);
}
}
private void btnCreateLog_Click(object sender, EventArgs e) {
if (this.txtLogName.Text.Length != 0) {
myEventLog.WriteEntry("Test Message Written.");
}
}
TIA,
Doug