chiark / gitweb /
journalctl: add --local switch
[elogind.git] / man / journalctl.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3         "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5 <!--
6   This file is part of systemd.
7
8   Copyright 2012 Lennart Poettering
9
10   systemd is free software; you can redistribute it and/or modify it
11   under the terms of the GNU General Public License as published by
12   the Free Software Foundation; either version 2 of the License, or
13   (at your option) any later version.
14
15   systemd is distributed in the hope that it will be useful, but
16   WITHOUT ANY WARRANTY; without even the implied warranty of
17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18   General Public License for more details.
19
20   You should have received a copy of the GNU General Public License
21   along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 -->
23
24 <refentry id="journalctl">
25
26         <refentryinfo>
27                 <title>journalctl</title>
28                 <productname>systemd</productname>
29
30                 <authorgroup>
31                         <author>
32                                 <contrib>Developer</contrib>
33                                 <firstname>Lennart</firstname>
34                                 <surname>Poettering</surname>
35                                 <email>lennart@poettering.net</email>
36                         </author>
37                 </authorgroup>
38         </refentryinfo>
39
40         <refmeta>
41                 <refentrytitle>journalctl</refentrytitle>
42                 <manvolnum>1</manvolnum>
43         </refmeta>
44
45         <refnamediv>
46                 <refname>journalctl</refname>
47                 <refname>systemd-journalctl</refname>
48                 <refpurpose>Query the systemd journal</refpurpose>
49         </refnamediv>
50
51         <refsynopsisdiv>
52                 <cmdsynopsis>
53                         <command>journalctl <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="opt">MATCH</arg></command>
54                 </cmdsynopsis>
55         </refsynopsisdiv>
56
57         <refsect1>
58                 <title>Description</title>
59
60                 <para><command>journalctl</command> may be
61                 used to query the contents of the
62                 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
63                 journal.</para>
64
65                 <para>If called without parameter will show the full
66                 contents of the journal, starting with the oldest
67                 entry collected.</para>
68
69                 <para>If a match argument is passed the output is
70                 filtered accordingly. A match is in the format
71                 <literal>FIELD=VALUE</literal>,
72                 e.g. <literal>_SYSTEMD_UNIT=httpd.service</literal>.</para>
73
74                 <para>Output is interleaved from all accessible
75                 journal files, whether they are rotated or currently
76                 being written, and regardless whether they belong to the
77                 system itself or are accessible user journals.</para>
78
79                 <para>All users are granted access to their private
80                 per-user journals. However, by default only root and
81                 users who are members of the <literal>adm</literal>
82                 group get access to the system journal and the
83                 journals of other users.</para>
84         </refsect1>
85
86         <refsect1>
87                 <title>Options</title>
88
89                 <para>The following options are understood:</para>
90
91                 <variablelist>
92                         <varlistentry>
93                                 <term><option>--help</option></term>
94                                 <term><option>-h</option></term>
95
96                                 <listitem><para>Prints a short help
97                                 text and exits.</para></listitem>
98                         </varlistentry>
99
100                         <varlistentry>
101                                 <term><option>--version</option></term>
102
103                                 <listitem><para>Prints a short version
104                                 string and exits.</para></listitem>
105                         </varlistentry>
106
107                         <varlistentry>
108                                 <term><option>--no-pager</option></term>
109
110                                 <listitem><para>Do not pipe output into a
111                                 pager.</para></listitem>
112                         </varlistentry>
113
114                         <varlistentry>
115                                 <term><option>--all</option></term>
116                                 <term><option>-a</option></term>
117
118                                 <listitem><para>Show all fields in
119                                 full, even if they include unprintable
120                                 characters or are very
121                                 long.</para></listitem>
122                         </varlistentry>
123
124                         <varlistentry>
125                                 <term><option>--follow</option></term>
126                                 <term><option>-f</option></term>
127
128                                 <listitem><para>Show only most recent
129                                 journal entries, and continously print
130                                 new entries as they are appended to
131                                 the journal.</para></listitem>
132                         </varlistentry>
133
134                         <varlistentry>
135                                 <term><option>--lines=</option></term>
136                                 <term><option>-n</option></term>
137
138                                 <listitem><para>Controls the number of
139                                 journal lines to show, counting from
140                                 the most recent ones. Takes a positive
141                                 integer argument. In follow mode
142                                 defaults to 10, otherwise is unset
143                                 thus not limiting how many lines are
144                                 shown.</para></listitem>
145                         </varlistentry>
146
147                         <varlistentry>
148                                 <term><option>--no-tail</option></term>
149
150                                 <listitem><para>Show all stored output
151                                 lines, even in follow mode. Undoes the
152                                 effect of
153                                 <option>--lines=</option>.</para></listitem>
154                         </varlistentry>
155
156                         <varlistentry>
157                                 <term><option>--output=</option></term>
158                                 <term><option>-o</option></term>
159
160                                 <listitem><para>Controls the
161                                 formatting of the journal entries that are
162                                 shown. Takes one of
163                                 <literal>short</literal>,
164                                 <literal>short-monotonic</literal>,
165                                 <literal>verbose</literal>,
166                                 <literal>export</literal>,
167                                 <literal>json</literal>,
168                                 <literal>cat</literal>. <literal>short</literal>
169                                 is the default and generates an output
170                                 that is mostly identical to the
171                                 formatting of classic syslog log
172                                 files, showing one line per journal
173                                 entry. <literal>short-monotonic</literal>
174                                 is very similar but shows monotonic
175                                 timestamps instead of wallclock
176                                 timestamps. <literal>verbose</literal>
177                                 shows the full structered entry items
178                                 with all
179                                 fiels. <literal>export</literal>
180                                 serializes the journal into a binary
181                                 (but mostly text-based) stream
182                                 suitable for backups and network
183                                 transfer. <literal>json</literal>
184                                 formats entries as JSON data
185                                 structures. <literal>cat</literal>
186                                 generates a very terse output only
187                                 showing the actual message of each
188                                 journal entry with no meta data, not
189                                 even a timestamp.</para></listitem>
190                         </varlistentry>
191
192                         <varlistentry>
193                                 <term><option>--quiet</option></term>
194                                 <term><option>-q</option></term>
195
196                                 <listitem><para>Suppresses any warning
197                                 message regarding inaccessable system
198                                 journals when run as normal
199                                 user.</para></listitem>
200                         </varlistentry>
201
202                         <varlistentry>
203                                 <term><option>--local</option></term>
204                                 <term><option>-l</option></term>
205
206                                 <listitem><para>Show only locally
207                                 generated messages.</para></listitem>
208                         </varlistentry>
209
210                         <varlistentry>
211                                 <term><option>--new-id128</option></term>
212
213                                 <listitem><para>Instead of showing
214                                 journal contents generate a new 128
215                                 bit ID suitable for identifying
216                                 messages. This is intended for usage
217                                 by developers who need a new
218                                 identifier for a new message they
219                                 introduce and want to make
220                                 recognizable. Will print the new ID in
221                                 three different formats which can be
222                                 copied into source code or
223                                 similar.</para></listitem>
224                         </varlistentry>
225
226                 </variablelist>
227         </refsect1>
228
229         <refsect1>
230                 <title>Exit status</title>
231
232                 <para>On success 0 is returned, a non-zero failure
233                 code otherwise.</para>
234         </refsect1>
235
236         <refsect1>
237                 <title>Environment</title>
238
239                 <variablelist>
240                         <varlistentry>
241                                 <term><varname>$SYSTEMD_PAGER</varname></term>
242                                 <listitem><para>Pager to use when
243                                 <option>--no-pager</option> is not given;
244                                 overrides <varname>$PAGER</varname>.  Setting
245                                 this to an empty string or the value
246                                 <literal>cat</literal> is equivalent to passing
247                                 <option>--no-pager</option>.</para></listitem>
248                         </varlistentry>
249                 </variablelist>
250         </refsect1>
251
252         <refsect1>
253                 <title>See Also</title>
254                 <para>
255                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
256                         <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
257                         <citerefentry><refentrytitle>systemd-journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
258                 </para>
259         </refsect1>
260
261 </refentry>