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 <!ENTITY % entities SYSTEM
"custom-entities.ent" >
9 This file is part of systemd.
11 Copyright 2012 Lennart Poettering
13 systemd is free software; you can redistribute it and/or modify it
14 under the terms of the GNU Lesser General Public License as published by
15 the Free Software Foundation; either version 2.1 of the License, or
16 (at your option) any later version.
18 systemd is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 Lesser General Public License for more details.
23 You should have received a copy of the GNU Lesser General Public License
24 along with systemd; If not, see <http://www.gnu.org/licenses/>.
27 <refentry id=
"systemd-cat"
28 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
31 <title>systemd-cat
</title>
32 <productname>systemd
</productname>
36 <contrib>Developer
</contrib>
37 <firstname>Lennart
</firstname>
38 <surname>Poettering
</surname>
39 <email>lennart@poettering.net
</email>
45 <refentrytitle>systemd-cat
</refentrytitle>
46 <manvolnum>1</manvolnum>
50 <refname>systemd-cat
</refname>
51 <refpurpose>Connect a pipeline or program's output with the journal
</refpurpose>
56 <command>systemd-cat
<arg choice=
"opt" rep=
"repeat">OPTIONS
</arg> <arg>COMMAND
</arg> <arg choice=
"opt" rep=
"repeat">ARGUMENTS
</arg></command>
59 <command>systemd-cat
<arg choice=
"opt" rep=
"repeat">OPTIONS
</arg></command>
64 <title>Description
</title>
66 <para><command>systemd-cat
</command> may be used to connect the
67 standard input and output of a process to the journal, or as a
68 filter tool in a shell pipeline to pass the output the previous
69 pipeline element generates to the journal.
</para>
71 <para>If no parameter is passed,
<command>systemd-cat
</command>
72 will write everything it reads from standard input (stdin) to the
75 <para>If parameters are passed, they are executed as command line
76 with standard output (stdout) and standard error output (stderr)
77 connected to the journal, so that all it writes is stored in the
82 <title>Options
</title>
84 <para>The following options are understood:
</para>
87 <xi:include href=
"standard-options.xml" xpointer=
"help" />
88 <xi:include href=
"standard-options.xml" xpointer=
"version" />
91 <term><option>-t
</option></term>
92 <term><option>--identifier=
</option></term>
94 <listitem><para>Specify a short string that is used to
95 identify the logging tool. If not specified, no identification
96 string is written to the journal.
</para></listitem>
100 <term><option>-p
</option></term>
101 <term><option>--priority=
</option></term>
103 <listitem><para>Specify the default priority level for the
104 logged messages. Pass one of
105 <literal>emerg
</literal>,
106 <literal>alert
</literal>,
107 <literal>crit
</literal>,
108 <literal>err
</literal>,
109 <literal>warning
</literal>,
110 <literal>notice
</literal>,
111 <literal>info
</literal>,
112 <literal>debug
</literal>, or a
113 value between
0 and
7 (corresponding to the same named
114 levels). These priority values are the same as defined by
115 <citerefentry project='man-pages'
><refentrytitle>syslog
</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
116 Defaults to
<literal>info
</literal>. Note that this simply
117 controls the default, individual lines may be logged with
118 different levels if they are prefixed accordingly. For details
119 see
<option>--level-prefix=
</option> below.
</para></listitem>
123 <term><option>--level-prefix=
</option></term>
125 <listitem><para>Controls whether lines read are parsed for
126 syslog priority level prefixes. If enabled (the default), a
127 line prefixed with a priority prefix such as
128 <literal><5></literal> is logged at priority
5
129 (
<literal>notice
</literal>), and similar for the other
130 priority levels. Takes a boolean argument.
</para></listitem>
138 <title>Exit status
</title>
140 <para>On success,
0 is returned, a non-zero failure code
145 <title>Examples
</title>
148 <title>Invoke a program
</title>
150 <para>This calls
<filename noindex='true'
>/bin/ls
</filename>
151 with standard output and error connected to the journal:
</para>
153 <programlisting># systemd-cat ls
</programlisting>
157 <title>Usage in a shell pipeline
</title>
159 <para>This builds a shell pipeline also invoking
160 <filename>/bin/ls
</filename> and writes the output it generates
161 to the journal:
</para>
163 <programlisting># ls | systemd-cat
</programlisting>
166 <para>Even though the two examples have very similar effects the
167 first is preferable since only one process is running at a time,
168 and both stdout and stderr are captured while in the second
169 example, only stdout is captured.
</para>
173 <title>See Also
</title>
175 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
176 <citerefentry><refentrytitle>systemctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
177 <citerefentry project='man-pages'
><refentrytitle>logger
</refentrytitle><manvolnum>1</manvolnum></citerefentry>