public void Customize(BusConfiguration configuration) { // NServiceBus provides the following durable storage options // To use RavenDB, install-package NServiceBus.RavenDB and then use configuration.UsePersistence<RavenDBPersistence>(); // To use SQLServer, install-package NServiceBus.NHibernate and then use configuration.UsePersistence<NHibernatePersistence>(); // If you don't need a durable storage you can also use, configuration.UsePersistence<InMemoryPersistence>(); // more details on persistence can be found here: http://docs.particular.net/nservicebus/persistence-in-nservicebus //Also note that you can mix and match storages to fit you specific needs. //http://docs.particular.net/nservicebus/persistence-order configuration.UsePersistence <InMemoryPersistence>(); configuration.DisableFeature <SecondLevelRetries>(); ConfigureLogging.NLog(); configuration.DefineMessageConventions(); }
/// <summary> /// Register services in the DI container. /// </summary> /// <param name="services">The services collection.</param> /// <returns>The updated services collection.</returns> public static IServiceCollection RegisterInfrastructureServices(this IServiceCollection services) { // Context Providers services.AddSingleton <IHealthCheck, WebSiteHealthCheck>(); services.AddScoped <ILogEventEnricher, LoggingEnricher>(); // we need to add this long hand so resolve some bits first var provider = services.BuildServiceProvider(); var logOptions = provider.GetRequiredService <IOptions <SerilogOptions> >(); var hosting = provider.GetRequiredService <IHostingEnvironment>(); var logEnricher = provider.GetRequiredService <ILogEventEnricher>(); // create a new instance and register var configureLogging = new ConfigureLogging(hosting, logOptions, logEnricher); services.AddSingleton <IConfigureLogging>(configureLogging); // now configure configureLogging.Configure(); return(services); }
public void Then_LogToCategoryNamed_ThrowsArgumentException() { ConfigureLogging.LogToCategoryNamed(null); }
protected override void Arrange() { base.Arrange(); CategorySourceBuilder = ConfigureLogging.LogToCategoryNamed(categoryName); }