Question

Log files on App Platform

Posted September 15, 2021 90 views
Node.jsDigitalOcean App Platform

I want to host my Nextjs app on App Platform .My question is, how can i access logfiles created by Winston in the root directory of my project ? Is there a way to access such path approot/logs/error.log ?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hello,

You can view your application logs by following the steps here:

https://docs.digitalocean.com/products/app-platform/how-to/view-logs/

I personally like the doctl command-line tool and I use the command from the documentation to do so:

doctl apps logs <app id> <component name> --deployment <deployment id> --type <type value>

If you decide to store your logs inside the App component, you need to keep in mind that the storage is not persistent, so during your next deployment, the log will be lost.

For more information on persistent storage, I would recommend going through this documentation here:

https://docs.digitalocean.com/products/app-platform/how-to/store-data/

Hope that this helps.
Regards,
Bobby