1

I have an application that uses the System.Diagnostics.Trace and System.Diagnostics.EventLog classes to generate the logging information of the application.

I know that it is possible to configure an Azure role to automatically save the information stored by System.Diagnostics.Trace into Azure Storage.

I want to know if there is something I can do to get the same behavior with the System.Diagnostics.EventLog (change some configuration in the Azure role and have the EventLog data stored to Azure Storage).

Regards

2 Answers 2

1

For diagnostics trace, you need to:

  • use the diagnostics trace listener Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener in your web.config
  • ensure that your Logs.ScheduledTransferPeriod is setup

For event log tracing, you need to configure the diagnostics to trace the Application event logs:

config.WindowsEventLog.DataSources.Add(“Application!*”);
// can also add System if you want to: config.WindowsEventLog.DataSources.Add(“System!*”);
config.WindowsEventLog.ScheduledTransferPeriod = TimeSpan.FromMinutes(5);

For full instructions see http://blog.bareweb.eu/2011/01/beginning-azure-diagnostics/

2
  • Hi Stuart, thanks for your answer. The problem is that those steps will help me save the information saved by System.Diagnostics.Trace which I already know how to do. What I need is something similar but for the System.Diagnostics.EventLog class.
    – willvv
    Jun 17, 2011 at 19:05
  • Ah - sorry! Those entries write to the application event log in windows - have added a comment about these too.
    – Stuart
    Jun 17, 2011 at 19:50
0

Actually, nothing is automatically saved in storage. The information is buffered into the role on disk and then transferred (on demand or scheduled) to storage. So, you can definitely do the same thing with EventLogs. You just use them like normal, configure Diagnostics to monitor them and occasionally transfer to storage. Use the Windows Azure MMC for a free tool to do this easily.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.