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

Configuring different event IDs for logged messages. #244

Open
gosub3000 opened this issue Mar 1, 2024 · 2 comments
Open

Configuring different event IDs for logged messages. #244

gosub3000 opened this issue Mar 1, 2024 · 2 comments

Comments

@gosub3000
Copy link

gosub3000 commented Mar 1, 2024

Hi,
When logging messages through log4jna every event in the Windows Event Viewer has the same event ID (4096). Is it possible to specify different IDs per message, and if so how?

Kind regards,
Chris

@dblock
Copy link
Owner

dblock commented Mar 1, 2024

I had written https://code.dblock.org/2010/10/14/log4jna-the-description-for-event-id-4096-from-source-log4jna-cannot-be-found.html to explain what this ID is, check it out?

The message ID is hardcoded in

. You'd need to expose that, but that obviously will have other consequences on rendering messages.

PRs welcome!

@sergueik
Copy link

sergueik commented Apr 14, 2024

one can use %SystemRoot%\Microsoft.NET\Framework\v4.0.30319\EventLogMessages.dll and make eventid an appender property - has templates for arbitrary
if one does not want to have to create one can pic existing id / application /service / Message Category resource dll e.g.

1000 Application Application Error wer.dll

the quick brown fox jumps over the lazy dog

see the logback backed
https://github.com/sergueik/springboot_study/tree/master/basic-logback-eventlog
and standalone
https://github.com/sergueik/springboot_study/tree/master/basic-jna-eventlog

wips of mine

the https://github.com/sergueik/springboot_study/tree/master/basic-log4j-eventlog is where I prepare the PR

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

No branches or pull requests

3 participants