Can you recommend what I should be using to do that?
+14
A:
Log4J with this
http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/nt/NTEventLogAppender.html
Lou Franco
2008-10-02 22:27:30
Log4J is a good choice because your code doesn't get coupled to the underlying logging target and its easily configured through XML.
bmatthews68
2008-10-02 22:52:10
+4
A:
Back in 2001 JavaWorld published an article on how to write messages to the Windows NT Event Log. Or, you can take a look at the Log4j NTEventLogAppender class.
TomC
2008-10-02 22:28:33
+1
A:
You can also use the eventcreate command on Windows XP Pro and above.
String command = "eventcreate "
+ " /l APPLICATION"
+ " /so \"" + applicationObjectName + "\""
+ " /t " + lvl
+ " /id " + id
+ " /d \"" + description + "\"";
Runtime.getRuntime().exec(command);
For XP home and lower, you could create a vbs application that writes using the wscript.shell.eventcreate method. However you sacrifice the ability to specify source.
Example: http://www.ozzu.com/mswindows-forum/posting-event-log-with-batch-files-t76791.html
Andrew
2010-02-07 04:04:16