首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >NServiceBus日志到自定义日志

NServiceBus日志到自定义日志
EN

Stack Overflow用户
提问于 2012-04-10 12:32:14
回答 2查看 1.1K关注 0票数 4

我注意到,当我在/install上调用NServiceBus.host.exe标志时,将在Application日志下创建一个事件日志源。问题是,我们已经将NServiceBus L4N配置为将事件写入相同的源,但使用自定义事件日志。

这会导致一个问题,因为如果我们在自定义事件日志下创建源,安装就会失败(NserviceBus安装程序抛出一个System.ArgumentException:源blah已经存在于本地计算机上)。

那么,我们如何阻止NServiceBus安装程序尝试在应用程序事件日志下创建事件源呢?

我们使用的是NServiceBus 3.0.1.0

谢谢

编辑-全堆栈跟踪

代码语言:javascript
复制
Creating EventLog source blah in log Application...

An exception occurred during the Install phase.
System.ArgumentException: Source blah already exists
on the local computer.

The Rollback phase of the installation is beginning.
Restoring event log to previous state for source blah
.
Service blah is being removed from the system...
Service blah was successfully removed from the system
.

The Rollback phase completed successfully.

Unhandled Exception: System.InvalidOperationException: The installation failed, and the rollback has been performed. ---> System.ArgumentException: Source blah already exists on the local computer.
   at System.Diagnostics.EventLog.CreateEventSource(EventSourceCreationData sourceData)
   at System.Diagnostics.EventLogInstaller.Install(IDictionary stateSaver)
   at System.Configuration.Install.Installer.Install(IDictionary stateSaver)
   at System.ServiceProcess.ServiceInstaller.Install(IDictionary stateSaver)
   at System.Configuration.Install.Installer.Install(IDictionary stateSaver)
   at Topshelf.Internal.Hosts.HostServiceInstaller.Install(IDictionary stateSaver) 
in d:\dev\open-source\topshelf\src\Topshelf\Internal\Hosts\HostServiceInstaller.cs:line 120
   at System.Configuration.Install.Installer.Install(IDictionary stateSaver)
   at System.Configuration.Install.TransactedInstaller.Install(IDictionary savedState)
   --- End of inner exception stack trace ---
   at System.Configuration.Install.TransactedInstaller.Install(IDictionary savedState)
   at Topshelf.Internal.Hosts.HostServiceInstaller.Register() in d:\dev\open-source\topshelf\src\Topshelf\Internal\Hosts\HostServiceInstaller.cs:line 61
   at Topshelf.Internal.Actions.InstallServiceAction.Do(IRunConfiguration configuration) in d:\dev\open-source\topshelf\src\Topshelf\Internal\Actions\InstallServiceAction.cs:line 42
   at Topshelf.Runner.Host(IRunConfiguration configuration, String[] args) in d:\dev\open-source\topshelf\src\Topshelf\Runner.cs:line 70
   at NServiceBus.Hosting.Windows.Program.Main(String[] args) in d:\BuildAgent-03\work\nsb.masterbuild1\src\hosting\NServiceBus.Hosting.Windows\Program.cs:line 122
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-04-10 15:00:53

只有在将Log4net配置为与端点名称相同的事件源名称时,才会出现此问题。

因此,我们可以在事件日志中使用不同的源名(在我们的例子中是<endpoint-name>.l4n)。就目前而言,这将解决这一问题。

票数 2
EN

Stack Overflow用户

发布于 2012-07-21 12:01:31

如果事情确实是梨形的,您可以在注册表中找到事件日志源。

代码语言:javascript
复制
HKLM/SYSTEM/ControlSet001/services/eventlog/...

在那里,您可以手动删除不再需要的事件日志源。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10088864

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档