Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>AaronS' answer is in the good direction, but there are some points I wanted to add:</p> <ul> <li>If you want to access ServerManager from your WebRole.cs you'll need to run your role in evelated context in order to be allowed use ServerManager.</li> </ul> <blockquote> <pre><code>&lt;Runtime executionContext="elevated"/&gt; </code></pre> </blockquote> <ul> <li>Like AaronS already explained, you can use ServerManager to access the log directory. This sample code is a little more "Azure-friendly":</li> </ul> <hr> <pre><code>using (ServerManager serverManager = new ServerManager()) { var siteName = RoleEnvironment.CurrentRoleInstance.Id + "_Web"; var id = serverManager.Sites[siteName].Id; var logFile = serverManager.Sites[siteName].LogFile; var iisLogDirectory = String.Format("{0}\\W3SVC{1}", logFile.Directory, id); } </code></pre> <hr> <ul> <li>Why not simply use the Windows Azure Diagnostics? As you can see from the <a href="http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.diagnostics.diagnosticmonitorconfiguration.aspx" rel="noreferrer">MSDN article</a>, wad-<strong>iis-failedreqlogfiles</strong>, wad-<strong>iis-logfiles</strong>, and wad-<strong>crash-dump</strong> are automatically taken into account. This means if you configure the DiagnosticMonitor properly, it will ship your logs every X minutes to a storage account. This is great if you have multiple servers running (and even if you only have 1), since you can access all your logs in a central place. I've used CloudXplorer recently to access my logs since it gives you an Explorer-like experience when browsing your files.</li> </ul> <p><strong>Note:</strong> For my 3 remarks I'm assuming you are using a PaaS WebRole (and not a IaaS VM).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload