I have a doubt with Azure Trace Logs. I have a Worker Role and I want to log certain events,
When we deploy the application locally we can read the Trace using Cerebrata Cerebrata Cloud Storage. But when we deploy to staying or production we can't. We are using the same Storage accounts.
Worker Code:
public override bool OnStart()
{
// Set the maximum number of concurrent connections
ServicePointManager.DefaultConnectionLimit = 12;
DiagnosticMonitorConfiguration diagnosticMonitorConfiguration = DiagnosticMonitor.GetDefaultInitialConfiguration();
diagnosticMonitorConfiguration.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1.0);
diagnosticMonitorConfiguration.Logs.ScheduledTransferLogLevelFilter = LogLevel.Verbose;
CloudStorageAccount cloudStorageAccount = CloudStorageAccount.DevelopmentStorageAccount;
DiagnosticMonitor diagnosticMonitor = DiagnosticMonitor.Start(cloudStorageAccount, diagnosticMonitorConfiguration);
return base.OnStart();
}
public override void Run()
{
// This is a sample worker implementation. Replace with your logic.
Trace.WriteLine("UpdateWorker entry point called", "Information");
while (true)
{
Thread.Sleep(5000);
Trace.WriteLine("Working", "Information" + DateTime.Now);
}
}
App.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
</configuration>
Where should we look? Is something wrong with this code?
Thanks!