-
Notifications
You must be signed in to change notification settings - Fork 10
Logging
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);
- Quick Start
- Introduction
- Casing in point: Topics and topics, Subscriptions and subscriptions
- Installing AzureNetQ
- Connecting to Service Bus
- Logging
- Publish
- Subscribe
- Request Response
- Send Receive
- Topic Based Routing
- Controlling Queue names
- Polymorphic Publish and Subscribe
- Scheduling Events with Future Publish
- Auto Subscriber
- Non Generic Publish & Subscription Extension Methods
- Replacing AzureNetQ Components
- Using a DI Container