CrashDumps.EnableCollection Method
Enables collection of mini crash dumps or full crash dumps for a role instance.
Namespace: Microsoft.WindowsAzure.Diagnostics
Assembly: Microsoft.WindowsAzure.Diagnostics (in Microsoft.WindowsAzure.Diagnostics.dll)
Assembly: Microsoft.WindowsAzure.Diagnostics (in Microsoft.WindowsAzure.Diagnostics.dll)
Parameters
- enableFullDumps
Type: System.Boolean
If true, collects full crash dumps. If false, collects mini crash dumps.
When you enable collection of crash dumps, the resulting data is written to the CrashDumps directory in the DiagnosticStore local resource that is automatically configured for your role.
When crash dump data is transferred to persistent storage, it is stored to the wad-crash-dumps Blob container. You can specify the transfer interval of the CrashDumps directory by setting the ScheduledTransferPeriod property of Directories.
Example
The following code snippet creates a DiagnosticMonitorConfiguration object, enables full crash dump collection, and sets a transfer interval of 30 minutes.
public override bool OnStart()
{
// Get the default initial configuration for DiagnosticMonitor.
DiagnosticMonitorConfiguration diagnosticConfiguration = DiagnosticMonitor.GetDefaultInitialConfiguration();
// Enable full crash dump collection.
CrashDumps.EnableCollection(true);
// Schedule a transfer period of 30 minutes.
diagnosticConfiguration.Directories.ScheduledTransferPeriod = TimeSpan.FromMinutes(30.0);
// Start the DiagnosticMonitor using the diagnosticConfig and our connection string.
DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", diagnosticConfiguration);
return base.OnStart();
}
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Development Platforms
Windows Vista, Windows 7 and Windows Server 2008Target Platforms
Diagnostic manager must have time to upload
If running, the default configuration of the diagnostic manager will upload these to "wad-crash-dumps". They are normally stored in the local storage name "DiagnosticStore", which I guess has cleanOnRoleRecycle set to false. Anyway, if your role is continuously crashing then it may never finish doing this before it is terminated and the role is recycled.
- 4/27/2011
- oliverbock