undefined
undefined

Reputation: 34248

Duplicate log entries with NServiceBus

I have duplicate entries in my log file for NServiceBus and I'm concerned this means I'm not starting it up correctly.

eg:

2012-03-21 10:44:37.9820|WARN|NServiceBus.Licensing|No valid license file was found. The host will be limited to 1 worker thread.

2012-03-21 10:44:37.9820|WARN|NServiceBus.Licensing|No valid license file was found. The host will be limited to 1 worker thread.

2012-03-21 10:44:38.0610|WARN|NServiceBus.Utils.MsmqUtilities|Queue spy\private$\error does not exist.

2012-03-21 10:44:38.0610|WARN|NServiceBus.Utils.MsmqUtilities|Queue spy\private$\error does not exist.

My config looks like this:

Configure.With()
                .DefiningCommandsAs(t => typeof(ICommand).IsAssignableFrom(t))
                .DefiningEventsAs(t => typeof(IEvent).IsAssignableFrom(t))
                .DefiningMessagesAs(t => typeof(IMessage).IsAssignableFrom(t))
                .Log4Net<NlogAppenderForLog4Net>(a => { })
                .NinjectBuilder(Kernel)
                .XmlSerializer()
                .MsmqTransport()
                    .DefineEndpointName("subscriber.input")
                    .IsTransactional(true)
                    .PurgeOnStartup(false)
                .MsmqSubscriptionStorage("subscriber")
                .UnicastBus()
                    .LoadMessageHandlers()
                    .ImpersonateSender(false)
                .CreateBus().Start(() => Configure.Instance.ForInstallationOn<NServiceBus.Installation.Environments.Windows>().Install());

and app.config:

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="MsmqTransportConfig" type="NServiceBus.Config.MsmqTransportConfig, NServiceBus.Core"/>
    <section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core"/>
    <section name="MessageForwardingInCaseOfFaultConfig" type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core" />
    <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" requirePermission="false" />
  </configSections>

    <MessageForwardingInCaseOfFaultConfig ErrorQueue="error"/>

    <UnicastBusConfig>
        <MessageEndpointMappings>
            <add Messages="Publisher.Events" Endpoint="publisher.input" />
            <add Messages="Publisher2.Events.Message, Publisher2.Events" Endpoint="publisher2.input" />
        </MessageEndpointMappings>
    </UnicastBusConfig>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    </startup>
    <runtime>
    </runtime>
</configuration>

Upvotes: 0

Views: 535

Answers (1)

Andreas &#214;hlund
Andreas &#214;hlund

Reputation: 5273

The NServiceBus profiles configure their own logging by default. You need to implement IWantCustomLogging to tell NSB that you're setting up logging your self.

Sample:

http://docs.particular.net/samples/logging/hostcustom/

Upvotes: 1

Related Questions