2

Is there a simple way to trace or write some log in a ASP.Net MVC3 Azure Web Role ?
I just want to write some informations and look in a log file if they were printed.
Like : WriteLine("Start Function A");

David Makogon
  • 69,407
  • 21
  • 141
  • 189
MaT
  • 1,556
  • 3
  • 28
  • 64

1 Answers1

3

You need a way to get to these trace statements outside of Windows Azure, and the way Windows Azure handles this is through its diagnostics monitor. All tracing then gets routed to a table (WADLogsTable), and you can then query this table either from the role instance itself or from an app running outside of Windows Azure (by doing Linq queries, maybe Cerebrata's Diagnostic Manager, etc.). This table will aggregate log output from all your role instances.

One of my teammates, Greg Oliver, recently blogged about the basics.

David Makogon
  • 69,407
  • 21
  • 141
  • 189
  • I looked at your teammate blob but I don't understand the way it works. It seems that de 2nd solution is the best but I don't understand the way it works. – MaT Jun 05 '12 at 13:15
  • Then I suggest looking at the Windows Azure article [here](https://www.windowsazure.com/en-us/develop/net/common-tasks/diagnostics/). It's actually very simple to use, and if you try it out, even in the emulator, I think you'll quickly be up to speed with it. – David Makogon Jun 05 '12 at 13:24