Skip to content

Instantly share code, notes, and snippets.

@chgeuer
Created September 20, 2012 12:50
Show Gist options
  • Select an option

  • Save chgeuer/3755701 to your computer and use it in GitHub Desktop.

Select an option

Save chgeuer/3755701 to your computer and use it in GitHub Desktop.
Für Mario
public override bool OnStart()
{
Trace.TraceInformation("OnStart() called");
MicrosoftCorpnetAuthenticationFixer.TweakIdentityWhenRunningInCorpnet();
TimeSpan scheduledTransferPeriod = TimeSpan.FromMinutes(1);
ServicePointManager.DefaultConnectionLimit = 12;
DiagnosticMonitorConfiguration diagConfig = DiagnosticMonitor.GetDefaultInitialConfiguration();
diagConfig.DiagnosticInfrastructureLogs.ScheduledTransferLogLevelFilter = LogLevel.Information;
diagConfig.DiagnosticInfrastructureLogs.ScheduledTransferPeriod = scheduledTransferPeriod;
diagConfig.WindowsEventLog.ScheduledTransferLogLevelFilter = LogLevel.Warning;
diagConfig.WindowsEventLog.ScheduledTransferPeriod = scheduledTransferPeriod;
diagConfig.Logs.ScheduledTransferLogLevelFilter = LogLevel.Verbose;
diagConfig.Logs.ScheduledTransferPeriod = scheduledTransferPeriod;
diagConfig.Directories.DataSources.Add(new DirectoryConfiguration
{
Path = new DirectoryInfo(@"SetupScripts\setuplogs").FullName,
Container = "setupscriptlogs",
DirectoryQuotaInMB = 100
});
diagConfig.Directories.ScheduledTransferPeriod = scheduledTransferPeriod;
diagConfig.ConfigurationChangePollInterval = TimeSpan.FromMinutes(1);
DiagnosticMonitor.Start(DiagnosticsConnectionString, diagConfig);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment