如何生成Windows日志以用于testing目的?

我试图用我的Windows日志来testing一些Splunk-y的东西。 但是我想要确定正在进入的日志,所以我可以确定我正在保存并丢弃日志。 我真正想要的是类似于Windows(7,如果可能的话)在UNIX / Linux上相当于“logging器”。

我发现EventCreate,但据我所知,我需要更改一些我的Splunkconfiguration使用该数据。

这样的事情存在吗?

编辑

我应该包括我的希望是写入系统和/或安全日志。 我意识到能够做到这一点存在一些风险,但我希望这是可能的。

那么,不知道为什么EventCreate不会为你工作。 这将写入系统日志。 你可以使用PowerShell,这几乎是做任何事情的新答案。

http://winpowershell.blogspot.com/2006/07/writing-windows-events-using.html窃取

$evt = new-object System.Diagnostics.EventLog("Application") $evt.Source = "MyEvent" $infoevent = [System.Diagnostics.EventLogEntryType]::Information $evt.WriteEntry("My Test Event",$infoevent,70) 

嘿,Powershell可以将事件写入事件日志。

Commandlet“Write-EventLog”

不知道你最初需要什么,但有一个Windows日志logging机制。 如果你真正想做的是将Windows日志发送到一个集中的服务器,看看网罗的开源项目http://www.intersectalliance.com/projects/index.html或在http://open.loglogic.com套索。