Skip to content

How to add a debug logger

Mats Alm edited this page Mar 21, 2014 · 4 revisions

Add a logger to get detailed debug output from the RabbitMqUtil.

1 - Create your own logger that implements the IRabbitMqLogger interface.

public class ConsoleLogger : IRabbitMqLogger
{
   public void Debug(string debug)
   {
       Console.WriteLine(debug);
   }
}

2 - Then resolve the RabbitMqLogger and attach your logger to it.

var container = new WindsorContainer();
container.Install(FromAssembly.Named("RabbitMQUtil"));
var logger = container.Resolve<RabbitMqLogger>();
logger.SetLogger(new ConsoleLogger());

« Back