Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I assign Event ID = 1 to all log entries written by Serilog.Sinks.EventLog #30

Closed
AllanXu49 opened this issue Jan 29, 2019 · 2 comments

Comments

@AllanXu49
Copy link

I have the following items in my App.COnfig and I can write to Windows Event Log

<add key="serilog:using:EventLog" value="Serilog.Sinks.EventLog" />
<add key="serilog:write-to:EventLog" />
<add key="serilog:write-to:EventLog.source" value="MyXYZSource" />
<add key="serilog:write-to:EventLog.manageEventSource" value="true" />

However I see junk messages in Eventlog along with my main message:

The description for Event ID 43413 from source MyXYZSource cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event: 

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The message resource is present but the message was not found in the message table

I have no idea where the Event ID 43413 came from????

The problem can be easily solved if I can assign Event ID = 1 to events Serilog writes.

Is there an easy way to do that in App.Config that I showed above?

@nblumhardt nblumhardt transferred this issue from serilog/serilog Jan 29, 2019
@nblumhardt
Copy link
Member

Hi - thanks for the note. I've just transferred this issue to the relevant repository, hopefully someone watching the discussion here will come up with a solution. If not, Stack Overflow's serilog tag can often attract some eyes :-)

Best regards,
Nick

@mrbcmorris
Copy link
Member

Hi @AllanXu49, I don't think we have app.config support for this behavior currently but with PR #23 we did add capability to customize the EventIds generated from LogEvents via managed code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants