When a pipeline run fails and the regular logs don't tell you enough, Azure DevOps has a built-in way to get more detail: system diagnostics. The classic way to turn it on is the "Enable system diagnostics" checkbox you get when you manually queue a run. But if your pipeline is defined in YAML and runs automatically on every push, there's no checkbox to click.
The checkbox approach
When you queue a pipeline manually, click Run pipeline and you'll see an Advanced options section with an Enable system diagnostics checkbox. Tick it, hit Run, and that single run gets verbose logging: purple-colored debug lines, extra detail on what each task is doing under the hood.
Remark: this only affects the run you're queuing. It doesn't persist, and it's useless for CI-triggered runs where nobody is manually clicking Run.
The YAML equivalent: system.debug
For YAML pipelines, the checkbox maps directly to a variable: system.debug. Set it to true and you get the exact same verbose logging, regardless of how the run was triggered.
variables:
system.debug: true
That's it. Add this to your pipeline, and every run — manual, CI-triggered, scheduled — gets verbose logs.
What you actually get
With system.debug: true, tasks emit information that's normally suppressed: variable resolution, internal decision points, and resource utilization per step (disk, memory, CPU). Search the logs for Agent environment resources and you'll see entries like:
##[debug]Agent environment resources - Disk: D:\ Available 12342.00 MB out of 14333.00 MB, Memory: Used 1907.00 MB out of 7167.00 MB, CPU: Usage 17.23%
Handy if you suspect a step is running into resource constraints on the agent, not just a logic error in your task.
Remark: setting system.debug to true also sets Agent.Diagnostic to true automatically. On self-hosted agents (v2.200.0+) that gets you network diagnostics too, useful when a step is failing to reach an external endpoint and you're not sure if it's your task or the agent's network.
Don't leave it on permanently
Verbose logs are noisy. Every task dumps a lot more than you need on a normal green run, and it makes scanning logs for the one problem you're chasing harder, not easier. Treat system.debug: true as something you add while debugging and remove afterwards. Same as you'd remove a Write-Host you dropped in a script to check a value.
If you only need it for a single run and don't want to touch the YAML at all, queue the run manually and use the checkbox instead. Same effect, zero risk of it lingering in your pipeline definition.