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