Christian
Christian

Reputation: 131

NServicebus creates new logfile at each restart

I think there must be an easy solution to my problem but I can't figure it out. We're using NServicebus in a windows service and we have configured it to use log4net for logging, in code we have this:

SetLoggingLibrary.Log4Net(log4net.Config.XmlConfigurator.Configure);

Configure.With().Log4Net().....

So far so good. The problem is that NServicebus still creates it's own logfile, named "logfile" placed the same folder the application is run in, i.e. amoung the binaries. In our development and test environments where we reinstall and restart the service frequently this soon polutes the binaries folder with a lot of logfiles as a new is created each day (the old one from a previous date is renamed to for instance: logfile2012-02-28).

In the config-file of the service we have these lines:

...

<section name="Logging" type="NServiceBus.Config.Logging, NServiceBus.Core" />

<Logging Threshold="OFF" />

so all logfiles are empty but how do we stop them from being created or at least have them created in a separate log folder?

Thanks

Christian

Upvotes: 0

Views: 388

Answers (1)

Udi Dahan
Udi Dahan

Reputation: 12057

Your calls to SetLoggingLibrary and .Log4Net() are conflicting with each other, and probably also with the profiles (if you're using NServiceBus.Host.exe).

Have you looked through the docs?

http://docs.particular.net/nservicebus/logging/

Upvotes: 1

Related Questions