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