1
votes

My project uses both NServiceBus and RavenDB. NServiceBus uses log4Net, and RavenDB uses NLog. How should I handle logging in my project? Do I need to pick one and somehow configure one of the projects to use a different logger? Or should I just let each of them do what they want and log my own stuff in whichever I choose?

I would prefer one error log for my entire application if possible.

1

1 Answers

2
votes

I would suggest that you instruct NServicebus to log to the NLog logger. To do that you need to implement a log4net.Appender.AppenderSkeleton which logs to NLog and then hook it into NService bus using

NServiceBus.Configure.With().Log4Net<YourAppender>(a => a.YourProperty = "value");

Read more about it at http://docs.particular.net/nservicebus/logging/.