Lou*_*nco 24
Log4J是一个基于Java的日志记录实用程序.该类NTEventLogAppender可用于"附加到NT事件日志系统".请参阅此处的文档:
http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/nt/NTEventLogAppender.html
编辑:有一个较新的版本, Log4j 2 ",它提供了相对于其前任的重大改进."
小智 5
您还可以在Windows XP Pro及更高版本上使用eventcreate命令.
String command = "eventcreate "
+ " /l APPLICATION"
+ " /so \"" + applicationObjectName + "\""
+ " /t " + lvl
+ " /id " + id
+ " /d \"" + description + "\"";
Runtime.getRuntime().exec(command);
Run Code Online (Sandbox Code Playgroud)
对于XP home和更低版本,您可以创建一个使用wscript.shell.eventcreate方法写入的vbs应用程序.但是你牺牲了指定源的能力.
示例:http: //www.ozzu.com/mswindows-forum/posting-event-log-with-batch-files-t76791.html
| 归档时间: |
|
| 查看次数: |
25115 次 |
| 最近记录: |