Will Eventlog ID be added?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Will Eventlog ID be added?

jrc168
Hello,

We plan to use NLog to add evenlog entries when errors happen. We would like to have even IDs for different errors. I check source code and find that eventlog ID is not used when an eventlog entry is added, so the ID is always zero.

Do you plan to add the support later? Thanks!

jrc168
Reply | Threaded
Open this post in threaded view
|

Re: Will Eventlog ID be added?

Jarek Kowalski
Administrator
How would you like to specify it?
Would this be sufficient for you:

if (logger.IsDebugEnabled)
{
    LogEventInfo le = new LogEventInfo(LogLevel.Info, logger.Name, "Message goes here");
    le.Context["EventID"] = 1234;
    logger.Log(le);
}

Being able to specify per-log-event context idata is on my todo list before 1.0.
NLog Blog
Reply | Threaded
Open this post in threaded view
|

Re: Will Eventlog ID be added?

jrc168
Yes. It will be sufficient. Thanks!