Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 6 down vote accepted

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.

share|improve this answer

you can use juju debug-log to get a distributed log of all operations by all agents. It allows suppressing things by log level, so give juju debug-log -h a read. It does miss a few things, but for the most part it should give you what you are looking for.

The following command shows all the logs from the beginning of time. So it will also show the logs from before you started juju debug-log

juju debug-log --replay
share|improve this answer
But does this answer the question? I need the output of the commands after they are executed. – Nathan Osman Nov 21 '11 at 23:24
That is exactly what the debug-log provides.. output of all commands executed by all agents (hooks, API calls, everything). Charms can also control what log level their output is produced at by using 'juju-log'. – SpamapS Nov 22 '11 at 0:01
But does this return the output of commands that have run before I call juju debug-log? – Nathan Osman Nov 22 '11 at 0:09
No, debug-log informs the agents that they need to start sending their logs. If you want to see the logs of agent activities past you must login to each unit and inspect the logs in /var/log/juju and /var/lib/juju – SpamapS Nov 22 '11 at 0:49
Yes, that was the question I asked and the answer below contains that information. – Nathan Osman Nov 22 '11 at 0:54

You can find the complete log inside the data-dir set in your environments.yaml file.

Open it with gksudo <path_to_data-dir>, navigate thru the folders to your units folder, open the service folder you want to have a look at and look at the unit.log file.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.