Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Azure

Running a healthy service in the cloud : Configuring the diagnostic agent (part 3)

3/22/2011 4:50:38 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

3. The other data sources

Up until now, we’ve discussed how to configure a performance counter data source and how to enable the trace listener in the web.config file. Now let’s look briefly at the other data sources that are configured in similar ways.

Crash Dumps

Crash dumps are the log file of last resort. They aren’t really a log file, but a dump of the status of the computer when a horrible problem has arisen. There are two types of crash dumps. The normal dump includes a copy of all the memory on the machine. The mini dump holds only the most important information, without a complete copy of everything.

If you’re running a web application, ASP.NET should handle any errors that aren’t handled by your application (in code or in the global.asax). A crash dump usually occurs only during a truly catastrophic error. When your code is running in a worker role, without the soft embrace of ASP.NET, you’re likely to see these dumps more often.

Crash dump files are stored in the local data buffer and transferred with the common logs. You can choose which size dump you want by passing in true to the Enable-Collection or EnableCollectionToDirectory method for a full dump and passing in false for a mini dump.

IIS Failed Request Logs

The failed request logs for IIS are a new feature in IIS 7. IIS tracks log data for requests as they come through, but keeps the data only if certain configurable conditions are met. A condition for keeping the log data might be that a response takes too long to complete the request. If the response is completed fast enough, then the log buffer is flushed. You can configure how IIS manages this process in the tracing section of the system.webServer part of your web.config. After you configure failed request tracing for IIS in this way, the logs are collected with the rest of the data logs.

Windows Event Logs

Windows event logs can provide important clues to serious problems with your applications. Some applications create custom event log sources for their own logging. The diagnostic agent in Azure can collect these logs and transfer them to storage for you.

You need to subscribe to the event data that you want to receive using an XPath expression. Because of the security profile your processes run on, you won’t be able to read the security windows event log. If you add this log to your configuration, nothing will be logged, and it won’t work correctly until you remove it.

To capture Windows event logs, you can use the following expression:

diagConfig.WindowsEventLog.DataSources.Add("System!*");

This code grabs everything from the Windows System Event log, which is where you usually want to start your investigations.

4. Arbitrary diagnostic sources

Windows Azure Diagnostics covers a lot of the diagnostic sources you might use to troubleshoot an issue with your system. It covers IIS logs, performance counters, Windows event logs, and several other things. Over time, you’ll probably devise your own diagnostic source; maybe a log you’re creating that you need to track. Perhaps this is custom billing data, or a compressed log of the images used in production, or it might just be the output of a third-party logging framework you’ve chosen to use.

The agent can transfer anything you want. All you need to do is get that data into a file in a designated folder. When you configure the agent, you tell it which custom directories you want it to monitor. You need to configure some local storage and then write your log files to it.

Each data source has a configuration class that you add to the agent’s configuration, and custom log locations aren’t any different. We’ll use the DirectoryConfiguration class to tell the agent to monitor a folder. You can set how large that directory is allowed to become, as well as scheduled transfer characteristics, as shown in the following code:


Windows Azure Diagnostics is a powerful tool you can use to help troubleshoot and diagnose problems. But it isn’t just for problems, as we’ve discussed; you can also use it to help monitor the behavior of the system, or the actions of your users. Although Windows Azure Diagnostics is wonderful, it’s only a source of data. You still need to analyze the data to turn it into information, and then take action. Sometimes the action you need to take is to change the configuration of the service model you’re running your application in. For example, you might need to add some instances to respond to a spike in traffic. Regardless of the result of your analysis, you’ll need to store the data you collect in Azure storage to be able to use it. To do this, you use transfers.

Other -----------------
- Running a healthy service in the cloud : Diagnostics in the cloud
- SOA Security with .NET and Windows Azure : Windows Identity Foundation (part 3)
- SOA Security with .NET and Windows Azure : Windows Identity Foundation (part 2) - Windows Cardspace & Active Directory Federation Services
- SOA Security with .NET and Windows Azure : Windows Identity Foundation (part 1) - Digital Identity
- SQL Azure and relational data : Common SQL Azure scenarios
- SQL Azure and relational data : Limitations of SQL Azure
- SQL Azure and relational data : Migrating an application to SQL Azure
- SQL Azure and relational data : Managing your database
- Authentication and Authorization with WCF (part 3) - Claims-Based Authorization
- Authentication and Authorization with WCF (part 2) - Role-Based Authorization
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server