Hi,
I am following the documentation here: https://docs.digitalocean.com/products/app-platform/how-to/view-logs/#crash-logs
And it says that in order to get the crash logs I must use the doctl CLI.
However I am running the command below, takes around 1 minute to complete but outputs nothing:
doctl apps logs <my_app_id> <my_component_name> --type=run_restarted
The same command, but using --type=run works fine.
I can confirm my app crashed a few hours ago by looking at “Insights” tab in App Platform, but I don’t know why, and I am looking for an answer.
Can anybody help me?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
It might be normal that you are not seeing anything from run_restarted. That log type only shows output that happened exactly at the moment the process restarted. If the app crashed without printing anything, the API can return an empty result, so what you are seeing could be expected.
Insights will still show a restart event even if there were no logs tied to it, for example if it was an OOM kill or the process exited too quickly to write anything. That could explain why --type=run shows output but --type=run_restarted comes back empty.
You could try pulling a larger window just in case:
doctl apps logs <app-id> <component> --type=run_restarted --tail=-1
If it still returns nothing, it is possible that there simply were no crash logs recorded.
I am not entirely sure though, so if you believe the app should have produced something, it might be worth asking support to check the internal event records. They can confirm whether the platform actually stored any restart logs for that timeframe.
Heya,
Another thing to check is whether the restart happened under a different deployment. run_restarted logs are tied to the deployment that was active at the time, and doctl only looks at the current one unless you specify it.
If the restart happened on an older deployment, this is the only way to see those logs. And if that still shows nothing, it likely means no crash logs were captured at all, which Support can confirm.
Hope that this helps!
I usually run something like:
doctl apps logs <APP-ID> --type=run_restarted --follow
That shows logs from runs that were restarted automatically. Make sure your app actually has restarts otherwise the command does not output anything.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.