You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Dunn, Kiril" <Ki...@dva.gov.au> on 2003/01/23 07:13:09 UTC

NT Event Log Appender doesn't work with large strings

I just discovered that when given a string longer than about 36K, the NT
Event Log Appender simply ignores the message, rather than raising an
exception or somesuch. This is an issue with Windows having a maximum length
for log entries, but should still be handled cleanly by Log4J.

I've attached a modified cpp file, that throws an exception when the
ReportEvent Windows API method call fails. It pulls the message from
Windows. My C coding skills are a little rusty, so someone with more skills
might want to have a look at what I changed (line 206 to 222) and fix it up
a bit if needed.

This compiles and works correctly with MinGW 3.2, Sun JDK 1.4.1_01 and Log4J
1.2.7 on Windows 2000. I haven't tested it with anything else.

Cheers,

Kiril