如何从命令行创建Windows EventLog源? [英] How to create Windows EventLog source from command line?

查看:509
本文介绍了如何从命令行创建Windows EventLog源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个ASP.NET应用程序,它会将一些东西记录到Windows EventLog。为此,必须先创建事件源。这需要管理权限,所以我不能在ASP.NET应用程序。

I'm creating an ASP.NET application that will log some stuff to Windows EventLog. To do this an event source has to be created first. This requires administrative priviledges so I cannot do it in the ASP.NET app.

有一个现有的命令行应用程序与Windows绑定,可以创建一个事件日志

Is there an existing command-line application that is bundled with Windows that can create an event log source, or must I roll out my own?

推荐答案

尝试eventcreate.exe



例如:

Try "eventcreate.exe"

An example:

eventcreate /ID 1 /L APPLICATION /T INFORMATION  /SO MYEVENTSOURCE /D "My first log"

这将创建一个新事件 source $ c> MYEVENTSOURCE 下 c $

This will create a new event source named MYEVENTSOURCE under APPLICATION event log as INFORMATION event type.

我认为这个工具只能从XP开始。

I think this utility is included only from XP onwards.

输入 eventcreate / ?

Type eventcreate /? in CMD prompt

Microsoft TechNet:Windows命令行参考: Eventcreate

Microsoft TechNet: Windows Command-Line Reference: Eventcreate

SS64:行参考: Eventcreate

SS64: Windows Command-Line Reference: Eventcreate

这篇关于如何从命令行创建Windows EventLog源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆