开发者

Azure: How to create the WADLogsTable for capturing diagnostics code?

开发者 https://www.devze.com 2023-01-31 17:53 出处:网络
I have a worker role that I would like to get diagnoistics feedback on... after adding the appropriate connection string to the ServiceConfiguration.cscfg and th开发者_如何转开发e following code:

I have a worker role that I would like to get diagnoistics feedback on... after adding the appropriate connection string to the ServiceConfiguration.cscfg and th开发者_如何转开发e following code:

//DiagnosticMonitor.Start("DiagnosticsConnectionString");
DiagnosticMonitorConfiguration diagConfig = DiagnosticMonitor.GetDefaultInitialConfiguration();
diagConfig.WindowsEventLog.DataSources.Add("Application!*");
diagConfig.WindowsEventLog.ScheduledTransferPeriod = System.TimeSpan.FromMinutes(5.0);
diagConfig.Logs.ScheduledTransferPeriod = System.TimeSpan.FromMinutes(5.0);

Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitor.Start("DiagnosticsConnectionString", diagConfig);
CrashDumps.EnableCollection(true);

When I call "System.Diagnostics.Trace.TraceInformation("test log") I expect to be able to find the record in the WADLogsTable of the target Azure Storage Account. Howver, the table doesn't exist- how is it created? None of the documentation I've read covers this.

Thanks in advance,


You'll want to set a log level filter, like:

diagConfig.Logs.ScheduledTransferLogLevelFilter = LogLevel.Information;

I have a more detailed answer here.

Note that occasionally, in the simulation environment, the tables don't get created immediately.

0

精彩评论

暂无评论...
验证码 换一张
取 消