Frage

I have node.js app which I deploying with Dokku, for the first after deployment app crashed and Docker container closed, so I checked my project on my computer again and found error. How can I debug errors on Dokku? Is there any console?

War es hilfreich?

Lösung

What you want is to see logs of the container running your node.js app. But as the container is closed you cannot attach to it to see outputs from stdout and stderr.

You can however see logs of closed containers.

To do so, first run docker ps -a, this will output even closed containers.

Then use docker logs <container-id> with the id of the closed container to fetch logs and debug your app.

Andere Tipps

I have an easier solution if you don't feel like messing with process management.

Dokku provide tools to help you manage your apps from the client.
The dokku-toolbelt is installed with npm :

npm install -g dokku-toolbelt

Once installed, open the command line from your app directory (or cd to it).

Now that you are in the good directory, you can use dt logs to see the latest console log.

If you want more "real time" logs, type dt logs -t. You can now see every console.log() (and more) from you nodejs dokku app.

Happy debug !

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top