내보내기(0) 인쇄
모두 확장
이 항목은 아직 평가되지 않았습니다.- 이 항목 평가

DiagnosticMonitor.Start 메서드 (CloudStorageAccount, DiagnosticMonitorConfiguration)

Starts a diagnostic monitor using the specified storage account and diagnostic monitor configuration.

네임스페이스: Microsoft.WindowsAzure.Diagnostics
어셈블리: Microsoft.WindowsAzure.Diagnostics(microsoft.windowsazure.diagnostics.dll)
‘사용 방법
Dim storageAccount As CloudStorageAccount
Dim initialConfiguration As DiagnosticMonitorConfiguration
Dim returnValue As DiagnosticMonitor

returnValue = DiagnosticMonitor.Start(storageAccount, initialConfiguration)
[EditorBrowsableAttribute(EditorBrowsableState.Advanced)] 
public static DiagnosticMonitor Start (
	CloudStorageAccount storageAccount,
	DiagnosticMonitorConfiguration initialConfiguration
)
/** @attribute EditorBrowsableAttribute(EditorBrowsableState.Advanced) */ 
public static DiagnosticMonitor Start (
	CloudStorageAccount storageAccount, 
	DiagnosticMonitorConfiguration initialConfiguration
)
EditorBrowsableAttribute(EditorBrowsableState.Advanced) 
public static function Start (
	storageAccount : CloudStorageAccount, 
	initialConfiguration : DiagnosticMonitorConfiguration
) : DiagnosticMonitor

매개 변수

storageAccount

Type: CloudStorageAccount

A CloudStorageAccount for storing diagnostic data.

initialConfiguration

Type: DiagnosticMonitorConfiguration

A DiagnosticMonitorConfiguration object that provides a custom initial configuration.

반환 값

Type: DiagnosticMonitor

Returns DiagnosticMonitor.

Data buffers are transferred to the specified CloudStorageAccount. The DiagnosticMonitorConfiguration object provides specific configuration options for your role instance.

This method also registers the diagnostics monitoring agent for notification when changes to configuration settings occur. If the value of the connection string is changed in the ServiceConfiguration.cscfg file, the diagnostics monitoring agent will be automatically reconfigured to use the new connection.

note참고
If your storage account is misconfigured, your role instance will start without diagnostics. To ensure that diagnostics will start, verify that your storage account is configured correctly before calling the Start(CloudStorageAccount,DiagnosticMonitorConfiguration) method.

Example

The following code snippet creates a DiagnosticMonitorConfiguration object, modifies the default configuration, and starts the DiagnosticMonitor by using a CloudStorageAccount:

public class WebRole : RoleEntryPoint
{
    public override bool OnStart()
    {
        // Create a CloudStorageAccount object using your credentials.
        StorageCredentialsAccountAndKey credentials = new StorageCredentialsAccountAndKey(accountName, accountKey);
        CloudStorageAccount storageAccount = new CloudStorageAccount(credentials, true);

        // Create a new DiagnosticMonitorConfiguration object.
        DiagnosticMonitorConfiguration dmConfig = DiagnosticMonitor.GetDefaultInitialConfiguration();

        // Transfer the default log containers to a storage account every 30 minutes.
        dmConfig.Directories.ScheduledTransferPeriod = TimeSpan.FromMinutes(30.0);

        // Start the DiagnosticMonitor with the new DiagnosticMonitorConfiguration.
        try
        {
            DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", dmConfig);
        {
        catch (ArgumentException ae)
        {
            // Handle any exceptions.
            System.Diagnostics.Trace.WriteLine(“Couldn’t start the DiagnosticMonitor.” + ae.Message);
        }

        return base.OnStart();
    }
}

이 형식의 모든 public static(Shared, Visual Basic의 경우) 멤버는 스레드로부터 안전합니다. 인터페이스 멤버는 스레드로부터 안전하지 않습니다.

개발 플랫폼

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Server 2008 및 Windows 2000

대상 플랫폼

이 정보가 도움이 되었습니까?
(1500자 남음)
의견을 주셔서 감사합니다.

커뮤니티 추가 항목

표시:
© 2014 Microsoft. All rights reserved.