Merge lp:~evilnick/clouddocs/logging into lp:~jujudocs/clouddocs/trunk

Proposed by Nick Veitch
Status: Merged
Approved by: Nick Veitch
Approved revision: 30
Merged at revision: 30
Proposed branch: lp:~evilnick/clouddocs/logging
Merge into: lp:~jujudocs/clouddocs/trunk
Diff against target: 88 lines (+60/-15)
1 file modified
Admin/Logging-Juju.md (+60/-15)
To merge this branch: bzr merge lp:~evilnick/clouddocs/logging
Reviewer Review Type Date Requested Status
Juju Docs hackers Pending
Review via email: mp+217851@code.launchpad.net

Description of the change

expanded logging section

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Admin/Logging-Juju.md'
2--- Admin/Logging-Juju.md 2014-04-28 22:58:36 +0000
3+++ Admin/Logging-Juju.md 2014-04-30 23:25:12 +0000
4@@ -1,24 +1,69 @@
5 Title: Logging - Juju
6 Status: In Progress
7
8-# Logging - Juju
9-
10-## Introduction
11-
12-**TODO**
13-
14-## Scope
15-
16-**TODO**
17+# Logging
18+
19+Logging is set up to occur on each instance. This includes the normal service logs
20+for whichever services are deployed on that particular instance. For example,
21+if you deploy the apache2 service, the logs will appear on that instance in
22+`/var/log/apache2/` as one might expect.
23+To examine instance level logs, you can simply use ssh to connect to a given
24+machine:
25+```
26+juju ssh <machine number>
27+```
28+The same directory also contains the juju logs for that service, located in
29+`/var/log/juju`.
30+However, it is often more useful to view the systemwide logs for Juju. Juju uses
31+rsyslogd to aggregate all logs to get a better systemwide view of Juju's
32+activity.
33+
34
35 ## Connecting to rsyslogd
36-
37-Juju already uses `rsyslogd` for the aggregation of all logs into one centralized log. The
38-target of this logging is the file `/var/log/juju/all-machines.log`. You can directly
39+The target of the aggregated log is the file `/var/log/juju/all-machines.log`. You can directly
40 access it using the command:
41
42-````
43-$ juju debug-log
44-````
45+```
46+juju debug-log [-n <number>] [-n +<number>] [-e <environment>]
47+```
48+
49+Where the -n switch is given and followed by a number, the log will be tailed from that many lines in the past (i.e., those number of existing lines in the log will be included in the output, along with any subsequent output).
50+
51+Where the -n switch is given and followed by a '+' and a number, the log will be tailed starting from that specific line in the log file.
52+
53+This somewhat unusual syntax has been chosen so that the command behaves like the standard Unix tail command. In fact, it is analagous to running tail -f [options] /var/log/juju/all-machines.log on the bootstrap node.
54+Examples:
55+
56+To read the ten most recent log entries and follow any subsequent entries to the log:
57+
58+
59+```
60+juju debug-log
61+```
62+
63+To read the thirty most recent log entries and follow any subsequent entries to the log:
64+
65+
66+```
67+juju debug-log -n 30
68+```
69+
70+To read all the log entries and follow any subsequent entries to the log:
71+
72+```
73+juju debug-log -n +1
74+```
75+
76+And of course it is possible to combine the command with other shell tools to make the
77+output more useful, e.g. to filter the whole log for lines matching 'INFO':
78+
79+```
80+juju debug-log -n +1 | grep 'INFO'
81+```
82+
83+!!!Note: As the command uses the follow behaviour of tail by default, you do not need to
84+specify the -f switch. You will also need to end the session with Control-C
85+
86+
87
88 **TODO** Describe a way to redirect this log to a central rsyslogd server.

Subscribers

People subscribed via source and target branches