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