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">
6 This file is part of systemd.
8 Copyright 2012 Lennart Poettering
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.
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.
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/>.
24 <refentry id="systemd-cat">
27 <title>systemd-cat</title>
28 <productname>systemd</productname>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
41 <refentrytitle>systemd-cat</refentrytitle>
42 <manvolnum>1</manvolnum>
46 <refname>systemd-cat</refname>
47 <refpurpose>Connect a pipeline or program's output with the journal</refpurpose>
52 <command>systemd-cat <arg choice="opt" rep="repeat">OPTIONS</arg> <arg>COMMAND</arg> <arg choice="opt" rep="repeat">ARGUMENTS</arg></command>
55 <command>systemd-cat <arg choice="opt" rep="repeat">OPTIONS</arg></command>
60 <title>Description</title>
62 <para><command>systemd-cat</command> may be used to
63 connect STDOUT and STDERR of a process with the
64 journal, or as a filter tool in a shell pipeline to
65 pass the output the previous pipeline element
66 generates to the journal.</para>
68 <para>If no parameter is passed,
69 <command>systemd-cat</command> will write
70 everything it reads from standard input (STDIN) to the journal.</para>
72 <para>If parameters are passed, they are executed as
73 command line with standard output (STDOUT) and standard
74 error output (STDERR) connected to the journal, so
75 that all it writes is stored in the journal.</para>
79 <title>Options</title>
81 <para>The following options are understood:</para>
85 <term><option>-h</option></term>
86 <term><option>--help</option></term>
88 <listitem><para>Prints a short help
89 text and exits.</para></listitem>
93 <term><option>--version</option></term>
95 <listitem><para>Prints a short version
96 string and exits.</para></listitem>
100 <term><option>-t</option></term>
101 <term><option>--identifier=</option></term>
103 <listitem><para>Specify a short string
104 that is used to identify the logging
105 tool. If not specified, no identification
106 string is written to the journal.</para></listitem>
110 <term><option>-p</option></term>
111 <term><option>--priority=</option></term>
113 <listitem><para>Specify the default
114 priority level for the logged
115 messages. Pass one of
116 <literal>emerg</literal>,
117 <literal>alert</literal>,
118 <literal>crit</literal>,
119 <literal>err</literal>,
120 <literal>warning</literal>,
121 <literal>notice</literal>,
122 <literal>info</literal>,
123 <literal>debug</literal>, or a
124 value between 0 and 7 (corresponding
125 to the same named levels). These
126 priority values are the same as
128 <citerefentry><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>. Defaults
129 to <literal>info</literal>. Note that
130 this simply controls the default,
131 individual lines may be logged with
132 different levels if they are prefixed
133 accordingly. For details see
134 <option>--level-prefix=</option>
135 below.</para></listitem>
139 <term><option>--level-prefix=</option></term>
141 <listitem><para>Controls whether lines
142 read are parsed for syslog priority
143 level prefixes. If enabled (the
144 default), a line prefixed with a
145 priority prefix such as
146 <literal><5></literal> is logged
148 (<literal>notice</literal>), and
149 similar for the other priority
150 levels. Takes a boolean
151 argument.</para></listitem>
159 <title>Exit status</title>
161 <para>On success, 0 is returned, a non-zero failure
162 code otherwise.</para>
166 <title>Examples</title>
169 <title>Invoke a program</title>
171 <para>This calls <filename noindex='true'>/bin/ls</filename>
172 with STDOUT/STDERR connected to the
175 <programlisting># systemd-cat ls</programlisting>
179 <title>Usage in a shell pipeline</title>
181 <para>This builds a shell pipeline also
182 invoking <filename>/bin/ls</filename> and
183 writes the output it generates to the
186 <programlisting># ls | systemd-cat</programlisting>
189 <para>Even though the two examples have very similar
190 effects the first is preferable since only one process
191 is running at a time, and both STDOUT and STDERR are
192 captured while in the second example only STDOUT is
197 <title>See Also</title>
199 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
200 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
201 <citerefentry><refentrytitle>logger</refentrytitle><manvolnum>1</manvolnum></citerefentry>