private void ConfigureLogging()
{
var configurationSource = new DictionaryConfigurationSource();
var builder = new ConfigurationSourceBuilder();
const string DefaultListenerName = "Default";
builder.ConfigureLogging()
.WithOptions
.DoNotRevertImpersonation()
.SpecialSources
.LoggingErrorsAndWarningsCategory
.SendTo.SharedListenerNamed(DefaultListenerName)
.SpecialSources
.UnprocessedCategory
.SendTo.SharedListenerNamed(DefaultListenerName)
.SpecialSources
.AllEventsCategory
.SendTo.SharedListenerNamed(DefaultListenerName)
.LogToCategoryNamed("General")
.WithOptions.SetAsDefaultCategory()
.SendTo.SharedListenerNamed(DefaultListenerName);
builder.UpdateConfigurationWithReplace(configurationSource);
var configurator = new UnityContainerConfigurator(this.Container);
EnterpriseLibraryContainer.ConfigureContainer(configurator, configurationSource);
this.Container.RegisterType<TraceListener, CommonLoggingEntlibTraceListener>(
DefaultListenerName,
new ContainerControlledLifetimeManager(),
new InjectionFactory(this.CreateListener));
}