Cloud services can log application diagnostics using the Trace
object in the code in worker and web roles and server diagnostics from the virtual machine instances that are hosting the roles.
We can configure a role's diagnostics in the role properties by double-clicking on the role in Visual Studio and looking at the Configuration tab:
We have options to enable and disable diagnostics with the Enable Diagnostics setting; then we have basic diagnostic levels of Errors only, which only logs errors, All information logs everything, and Custom plan gives us more fine-grained control over what we log with options for Application logs, Event logs, Performance counters, Infrastructure logs, and Log directories: