删除自定义事件日志源不使用代码 [英] Deleting Custom Event Log Source Without Using Code
问题描述
我已经创造了多项自定义事件日志源,以帮助过滤其输出的应用程序。我怎样才能删除本机自定义源无需编写任何代码的运行使用System.Diagnostics.EventLog.Delete是不可能的快速程序。
I have an application that has created a number of custom event log sources to help filter its output. How can I delete the custom sources from the machine WITHOUT writing any code as running a quick program using System.Diagnostics.EventLog.Delete is not possible.
我试过使用Regedit仿佛日志仍然在幕后存在去除[HKEY_LOCAL_MACHINE\SYSTEM\ControlSetXXX\Services\Eventlog然而应用程序行为的自定义源。
I've tried using RegEdit to remove the custom sources from [HKEY_LOCAL_MACHINE\SYSTEM\ControlSetXXX\Services\Eventlog] however the application acts as if the logs still exist behind the scenes.
我缺少的还有什么?
推荐答案
我也觉得你在正确的地方是......它存储在注册表,根据事件日志的名称。我有一个自定义事件日志,其下有多个事件源。
I also think you're in the right place... it's stored in the registry, under the name of the event log. I have a custom event log, under which are multiple event sources.
HKLM\System\CurrentControlSet\Services\Eventlog\\ \\LOGNAME\LOGSOURCE1
HKLM\System\CurrentControlSet\Services\Eventlog\LOGNAME\LOGSOURCE2
HKLM\System\CurrentControlSet\Services\Eventlog\LOGNAME\LOGSOURCE1 HKLM\System\CurrentControlSet\Services\Eventlog\LOGNAME\LOGSOURCE2
这些来源有一个的 EventMessageFile 的关键,这是* * REG_EXPAND_SZ,并指出:
Those sources have an EventMessageFile key, which is *REG_EXPAND_SZ* and points to:
C:\ Windows\Microsoft.NET\Framework\v2.0.50727\EventLogMessages.dll
C:\Windows\Microsoft.NET\Framework\v2.0.50727\EventLogMessages.dll
我想,如果你删除密钥是日志源,LOGSOURCE1在我的例子,这应该是所有需要。
I think if you delete the Key that is the log source, LOGSOURCE1 in my example, that should be all that's needed.
有关它的价值,我想它通过.NET,这就是它的所作所为。但是,它看起来像每个自定义事件日志也有相同名称的来源。如果你有一个自定义日志,这可能会影响您清除它的能力。你不得不彻底删除日志,也许吧。此外,如果你的应用程序有一个安装程序,我可以看到应用程序的名称也可以注册为应用程序事件日志源。还有一个地方就清楚了。
For what it's worth, I tried it through .NET and that's what it did. However, it does look like each custom event log also has a source of the same name. If you have a custom log, that could affect your ability to clear it. You'd have to delete the log outright, perhaps. Further, if your app has an installer, I can see that the application name also may be registered as a source in the application event log. One more place to clear.
这篇关于删除自定义事件日志源不使用代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!