我使用以下代码将跟踪日志保存到表存储中。 我正在使用windows azure skd 2.2版
System.Diagnostics.Trace.TraceError("START Log");
还在listener
web.config
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
还在webrole.cs
public override bool OnStart()
{
StartDiagnostics();
return base.OnStart();
}
private void StartDiagnostics()
{
DiagnosticMonitorConfiguration dmc = DiagnosticMonitor.GetDefaultInitialConfiguration();
TimeSpan tsOneMinute = TimeSpan.FromMinutes(1);
// Transfer logs to storage every minute
dmc.Logs.ScheduledTransferPeriod = tsOneMinute;
// Transfer verbose, critical, etc. logs
dmc.Logs.ScheduledTransferLogLevelFilter = LogLevel.Information;
// Start up the diagnostic manager with the given configuration.
try
{
DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", dmc);
}
catch (Exception exp)
{
}
}
仍然收到错误:500内部服务器错误