Last active
May 26, 2016 10:50
-
-
Save dvdstelt/409d2d81863ec1f6824a8a4fd7bf6e10 to your computer and use it in GitHub Desktop.
Endpoint configuration for logging everything
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using NServiceBus; | |
using NServiceBus.Hosting.Profiles; | |
using NServiceBus.Log4Net; | |
using NServiceBus.Logging; | |
| |
public class EndpointConfig : IConfigureThisEndpoint | |
{ | |
public EndpointConfig() | |
{ | |
var appDomainLogger = LogManager.GetLogger("AppDomain"); | |
AppDomain.CurrentDomain.FirstChanceException += (o, ea) => { appDomainLogger.Debug("FirstChanceException", ea.Exception); }; | |
AppDomain.CurrentDomain.UnhandledException += (o, ea) => { appDomainLogger.Debug("UnhandledException", ea.ExceptionObject as Exception); }; | |
} | |
void IConfigureThisEndpoint.Customize(BusConfiguration busConfiguration) | |
{ | |
busConfiguration.EndpointName("Samples.NServiceBus"); | |
busConfiguration.UseSerialization<JsonSerializer>(); | |
busConfiguration.UsePersistence<InMemoryPersistence>(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment