3. Overview
• Diagnostics in Windows Azure
– Application Level
– Service Level
– Operating System Level
• Things your application chooses to log
App
• Things logged by what runs your application
Service
• Things logged by OS container
OS
4. Example Log Usage
• Application:
– Error: Cannot save Order
• Service:
– Error: IO Exception
• OS:
– Error: Disk is full
5. What’s special?
• Familiar diagnostic challenges
– Already solved on premises
• Massively scalable
– No request affinity
– Unpredictable application topology
• Where do the logs go?!
– Centralised Logging approach
6. What you need
• Hosted Service:
– Compute capacity within Windows Azure
• Storage Account:
– Storage capacity within Windows Azure
• Table
• Blobs
7. Windows Azure Diagnostics
My Azure
Hosted Service App
Worker
Role Web Role
Role
Instances IN_0 IN_1 IN_0
• Each Role
– Configurable Diagnostics Monitor
– Each Instance inherits configuration
8. Example Trace Points
• Application
– .net application Tracing
– custom
• Files written via nLog, log4net etc
– Windows Event Log
• Service
– IIS Logs
– IIS Failed Request Logs
– Azure Diagnostics Infrastructure Logs
• Metalog
– Performance Counters
• Operating System
– Windows Event Log
– Custom (any known file log)
9. Configuration
• Set options on types
– Directories
– Logs
– Performance Counters
• Storage Options
– Some types allow a configurable destination
• Transfer Period
• Maximum Buffer Size
10. Transfer
• Two distinct methods of transfer
– Same underlying result
• On Demand Transfer
• Scheduled Transfer
11. Output formats
Type Description Destination
Trace With Trace Listener Table WADLogsTable
IIS Logs W3svc format Blob
Windows Event Logs Table WADWindowsEventLogsTable
Windows Performance Table WADPerformanceCountersTable
Counters
Custom Logs File based Blob
Crash Dump Blob
Diagnostic Infrastructure Metalog Table WADDiagnosticInfrastructureLogsTable
Log
13. Logging per Instance
• Logs on Instance Basis:
– RoleInstance:
• deployment(526).MultipleTraceSources.Host_IN_0
– DeploymentId.Role.Instance
• Allows for per instance diagnosis
14. Configure Windows Azure Diagnostics
• Setup Storage Account
• Create Role Instance Diagnostics Manager
• Get and update a configuration from Manager
• Set Current Configuration
19. Windows Azure Role Lifecycle
• Each Role runs
– OnStart
– Run
– OnStop
• Setup Diagnostics OnStart – always correct for
that role
• But if you change the config, another OnStart
will undo your changes
20. Change at Runtime
• WAPPSCmdlets
PowerShell cmdlets available at wappowershell.codeplex.com
Example courtesy of michaelwasham.com