Search code examples
c#azureazure-worker-roles

Worker Role Tracing Logging


I'm working out how to fix an issue with an Azure Worker Role.

Given

LogManager.GetCurrentClassLogger().Info("In index {0}", item); // in the source

Where am I likely to find that logged in a Azure Worker Role Cloud Service VM that I can log into with Remote Desktop?


Solution

  • First, you have to understand how logging and tracing works in azure cloud. Log file never generate on virtual machine. you can see them on your storage where you defined diagnostics for cloud services. for see how setup the diagnostic setting see below steps.

    A. In Solution Explorer, right-click the web or worker role to be configured and select Properties.

    B. On the properties page that appears, leave the Configuration tab selected. In the Diagnostics section, select the Enable Diagnostics check box, and click Configure.

    C. Use the remaining tabs to configure each of the diagnostic log sources.

    D. On the General tab, click Configure to the right of Storage Account Credentials to specify the Azure storage account to which diagnostic data will be copied.

    E. Click OK to apply the changes.

    F. Press Save to persist the changes you made to diagnostics.wadcfgx.

    or you can create custom logging by simple diagnostic log code.

    Once you setup the configuration all logs will store on your cloud storage. some details are specified below to understand where your log files saved by cloud.

    1. Azure application logs Web/Worker Table storage—WADLogsTable
    2. Diagnostics infrastructure logs Web/Worker Table storage—WADDiagnosticInfrastructureLogsTable
    3. Crash dumps Web/Worker Blob storage—Container you specify
    4. Event logs Web/Worker Table storage—WADWindowsEventLogsTable