How do I get the logs for a service? #26282
-
Hi, I’ve got several services that my job depends on. I’m fairly certain one of them is misbehaving. I’d like to view the logs for them, but, I can’t see them anywhere within github actions. Any suggestions? Cheers! |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
At the top right corner of the Actions tab, there is a link to view the raw logs. |
Beta Was this translation helpful? Give feedback.
-
https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions#job-context You can get the ID of a service container with “${{ job.services.<service_id>.id }}” With that you can do any regular docker operation you’d like, for example:
Heres a full working sample I have of using mysql:
The logs from the service container will then be in the logs of the step where you ran Depending on the service, |
Beta Was this translation helpful? Give feedback.
-
Thank you! Not sure where to put feature requests… would be good to have these automatically extracted and viewable within a tab somewhere in the UI. When a build fails I’d rather not have to start adding calls to docker to try and diagnose the failure :slight_smile: |
Beta Was this translation helpful? Give feedback.
-
This would not work if the “Initialize containers” step has failed. How do we troubleshoot such a failure? See for example https://github.com/api-platform/core/runs/260470103#step:2:133 |
Beta Was this translation helpful? Give feedback.
-
I’d like to know this too, I am having a similar issue with a MariaDB service (which incidentally was working fine a couple of days ago). |
Beta Was this translation helpful? Give feedback.
-
I’d like to have way to see logs for all these services |
Beta Was this translation helpful? Give feedback.
-
Hi We solved this using
|
Beta Was this translation helpful? Give feedback.
https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions#job-context
You can get the ID of a service container with “${{ job.services.<service_id>.id }}”
With that you can do any regular docker operation you’d like, for example:
Heres a full working sample I have of using mysql: