-
Notifications
You must be signed in to change notification settings - Fork 10
Logging
Mike Hadlow edited this page Nov 8, 2013
·
9 revisions
EasyNetQ provides a logger interface IEasyNetQLogger:
public interface IEasyNetQLogger
{
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 EasyNetQ logs to the console, which is probably not what you want in a production system. The debug level logging is very verbose and will not make much sense to someone without an intimate knowledge of AMQP and EasyNetQ. You should provide your own implementation of IEasyNetQLogger that logs info and error messages to your application's log. The RabbitHutch.CreateBus method provides overloads that allow you to replace any of the EasyNetQ components. See [Replacing EasyNetQ Components]. You can use this to register your custom logger with the bus. For example:
var logger = new MyLogger() // implements IEasyNetQLogger
var bus = RabbitHutch.CreateBus(“my connection string”, x => x.Register<IEasyNetQLogger>(_ => logger));
- 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