A day with .Net

My day to day experince in .net

Windows Event Logs

Posted by vivekcek on April 11, 2012

Windows event logs can be configured by the below code.These logs are transferred to azure table named “WADWindowsEventLogsTable”

 public override bool OnStart()
        {
            var config = DiagnosticMonitor.GetDefaultInitialConfiguration();

            config.WindowsEventLog.DataSources.Add("System!*");
            config.WindowsEventLog.BufferQuotaInMB = 200;
            config.WindowsEventLog.ScheduledTransferPeriod = TimeSpan.FromMinutes(1.0);
            config.WindowsEventLog.ScheduledTransferLogLevelFilter = LogLevel.Undefined;
            DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", config);
            return base.OnStart();

            
        }

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s