5

Are the logs stored locally on a self-hosted build where the agent is running?

When I bring up the UI for builds status of a running build it often is just stuck at Waiting for Console output.....

It would be nice to be able to go to the build agents machine and just look at the log and see what it is doing.

dropoutcoder
  • 2,627
  • 2
  • 14
  • 32
dean
  • 81
  • 1
  • 6
  • 1
    Clearly there are public articles, https://github.com/Microsoft/vsts-agent/blob/master/docs/troubleshooting.md – Lex Li Aug 28 '18 at 12:43
  • Did this kind of issue occurs on your each build or only for a specific build ? Have you tired with another build agent? – PatrickLu-MSFT Sep 03 '18 at 09:26
  • Thanks Lex/Patrick. Our build process is several hours long and sometime a step like a test case may take 10 minutes to complete. If I go to look at a running build through the UI I wont see any updates until the test completes. So then I don't know if it will complete or it is hung. I would like to log into the agent and look at the running log. I think as I commented below that I might be able to configure a local file logger and then the logs will be written to the agent as well as reported to the server. I report back if I get that working. – dean Sep 06 '18 at 22:08
  • Related probably: https://stackoverflow.com/questions/54211681/vsts-cd-stage-task-always-prints-log-in-one-go – Matt Jan 31 '19 at 15:30

1 Answers1

1

While the build running on VSTS with Hosted Agent the only way to see the logs is to wait for console output.

After the build finished you can download the logs az zip:

enter image description here

If the agent is Self Hosted (Private Agent) the logs are in the _diag folder (the folder exist in agnet root folder).

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
  • Yes, I can get the logs after it completes or even during if a step has finished. But I am talking about self hosted agents. Not Azure hosted agents. However taking a queue from looking at the old xaml style rules, I might be able to get the output by defining my own logger. I'll report back if I get it working. – dean Sep 06 '18 at 22:02
  • @shayki Have you found the log path in vsts self hosted agent? – Praveen sivadasan Jan 31 '19 at 10:00
  • 5
    @Praveensivadasan I updated now my answer: If the agent is Self Hosted (Private Agent) the logs are in the `_diag` folder (the folder exist in agnet root folder). – Shayki Abramczyk Jan 31 '19 at 12:50
  • To add to this, I found test logs during a test run in the "pages" folder inside the "_diag" folder. – Matthew Hostetler Oct 18 '19 at 21:33
  • @shayki Abramczyk, diag folder contains the hosted agent logs, not the pipeline logs. Do you have any idea about the pipeline logs location on hosted agent? – Shubham Arya Nov 23 '20 at 11:49