2012-04-10 16 views
4

NServiceBus.host.exeで/ installフラグを呼び出すと、アプリケーションイベントログの下にイベントログソースが作成されていることに気付きました。問題は、NServiceBus L4Nを設定して、同じソースにカスタムイベントログの下にイベントを書き込むことです。カスタムログへのNServiceBusのログ

私たちがカスタムイベントログのもとでソースを作成すると、インストールが失敗します(NserviceBusインストーラはSystem.ArgumentExceptionをスローします:ソースはローカルコンピュータに既に存在しています)。

NServiceBusインストーラがアプリケーションイベントログの下にイベントソースを作成しないようにするにはどうすればよいですか?完全なスタックトレース

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 
+0

NServiceBusはコンソール/ファイルにのみロギングするので、実際のロギングには関係していないと確信しています。私は100%確信していませんが、Windowsサービスをインストールするとイベントソースが作成されると思いますか? –

+0

トップシェルフが自動的にソースを作成している可能性があります。私は少し深く掘る必要があります –

+0

私はまったく同じ問題を抱えています。あなたはそれを引き起こしていたことを知りましたか? –

答えて

2
我々はエンドポイントと同じイベントソース名とlog4netのを設定している場合にのみ問題が発生し

- 私たちはNServiceBus 3.0.1.0

おかげ

EDITを使用している

名。

イベントログ(この場合は<endpoint-name>.l4n)に異なるソース名を使用できます。これは今のところ問題を回避するでしょう。

+0

私は同じ回避策で終わりました。 NServiceBus(またはtopshelf)が使用しているイベントソースを決めることができたらと思います。 –

2

物事は本当に洋ナシの形を行く場合は、あなたがそこからあなたのレジストリに

HKLM/SYSTEM/ControlSet001/services/eventlog/... 

をイベントログソースを見つけることができ、手動で必要なくなったイベントログソースを削除することができます。

+0

Jarrett問題は手動で解決されることはありません。すべての展開は自動化されています。 –