Skip to content
Pete Smith edited this page Jul 31, 2014 · 9 revisions

AzureNetQ provides a logger interface IAzureNetQLogger:

public interface IAzureNetQLogger
{
   void DebugWrite(string format, params object[] args);
   void InfoWrite(string format, params object[] args);
   void ErrorWrite(string format, params object[] args);
   void ErrorWrite(Exception exception);
}

By default AzureNetQ logs to the console, which is probably not what you want in a production system. You should provide your own implementation of IAzureNetQLogger that logs info and error messages to your application's log.

The debug level logging is quite simplistic, but it may be able to give you quick hints if you encounter problems. If you want detailed logging then refer to these links for Service Bus for Windows and Azure Service Bus

The AzureBusFactory.CreateBus method provides overloads that allow you to replace any of the AzureNetQ components. See Replacing AzureNetQ Components. When implemented, you will be able to use this to register your custom logger with the bus. For example:

var settings = new AzureNetQSettings {
    Logger = () => new MyLogger() // implements IAzureNetQLogger
};

var bus = AzureBusFactory.CreateBus(“my connection string”, settings);