forked from EasyNetQ/EasyNetQ
-
Notifications
You must be signed in to change notification settings - Fork 0
Logging
Mike Hadlow edited this page Nov 8, 2013
·
4 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
- A Note on Versioning
- Installing EasyNetQ
- Connecting to RabbitMQ
- Logging
- Publish
- Subscribe
- Request Response
- Send Receive
- Topic Based Routing
- Polymorphic Publish and Subscribe
- Publisher Confirms
- Scheduling Events with Future Publish
- Auto Subscriber
- Non Generic Publish & Subscription Extension Methods
- Error Conditions
- Re Submitting Error Messages With EasyNetQ.Hosepipe
- The Advanced API
- Cluster Support
- Wiring up EasyNetQ with TopShelf and Windsor
- Replacing EasyNetQ Components
- Using Alternative DI Containers