Ubuntu – Where does Juju store a log of all commands run and their output for each unit

jujuoutput

Sometimes when deploying a service (and more specifically a new unit) for a Juju charm, an error occurs and there seems to be no way of finding out exactly what it was.

Is there some sort of output log of all commands the unit ran?

Best Answer

It appears that each unit stores a log of the commands run in /var/log/juju/unit/unit-service_name-service_number.log. You can access it by taking advantage of Juju's ssh command like so:

juju ssh service_name/service_number

This will drop you into a shell for that unit. You can then use a text editor or even just cat | less to read the log.

Related Question