]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd-cat.xml
man: generate configured paths in manpages
[thirdparty/systemd.git] / man / systemd-cat.xml
CommitLineData
9aac0b2c
LP
1<?xml version='1.0'?> <!--*-nxml-*-->
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
681eb9cf
FB
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4<!ENTITY % entities SYSTEM "custom-entities.ent" >
5%entities;
6]>
9aac0b2c
LP
7
8<!--
9 This file is part of systemd.
10
44f44a29 11 Copyright 2012 Lennart Poettering
9aac0b2c
LP
12
13 systemd is free software; you can redistribute it and/or modify it
5430f7f2
LP
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
9aac0b2c
LP
16 (at your option) any later version.
17
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
5430f7f2 21 Lesser General Public License for more details.
9aac0b2c 22
5430f7f2 23 You should have received a copy of the GNU Lesser General Public License
9aac0b2c
LP
24 along with systemd; If not, see <http://www.gnu.org/licenses/>.
25-->
26
dfdebb1b 27<refentry id="systemd-cat"
798d3a52
ZJS
28 xmlns:xi="http://www.w3.org/2001/XInclude">
29
30 <refentryinfo>
31 <title>systemd-cat</title>
32 <productname>systemd</productname>
33
34 <authorgroup>
35 <author>
36 <contrib>Developer</contrib>
37 <firstname>Lennart</firstname>
38 <surname>Poettering</surname>
39 <email>lennart@poettering.net</email>
40 </author>
41 </authorgroup>
42 </refentryinfo>
43
44 <refmeta>
45 <refentrytitle>systemd-cat</refentrytitle>
46 <manvolnum>1</manvolnum>
47 </refmeta>
48
49 <refnamediv>
50 <refname>systemd-cat</refname>
51 <refpurpose>Connect a pipeline or program's output with the journal</refpurpose>
52 </refnamediv>
53
54 <refsynopsisdiv>
55 <cmdsynopsis>
56 <command>systemd-cat <arg choice="opt" rep="repeat">OPTIONS</arg> <arg>COMMAND</arg> <arg choice="opt" rep="repeat">ARGUMENTS</arg></command>
57 </cmdsynopsis>
58 <cmdsynopsis>
59 <command>systemd-cat <arg choice="opt" rep="repeat">OPTIONS</arg></command>
60 </cmdsynopsis>
61 </refsynopsisdiv>
62
63 <refsect1>
64 <title>Description</title>
65
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>
70
71 <para>If no parameter is passed, <command>systemd-cat</command>
72 will write everything it reads from standard input (stdin) to the
73 journal.</para>
74
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
78 journal.</para>
79 </refsect1>
80
81 <refsect1>
82 <title>Options</title>
83
84 <para>The following options are understood:</para>
85
86 <variablelist>
87 <xi:include href="standard-options.xml" xpointer="help" />
88 <xi:include href="standard-options.xml" xpointer="version" />
89
90 <varlistentry>
91 <term><option>-t</option></term>
92 <term><option>--identifier=</option></term>
93
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>
97 </varlistentry>
98
99 <varlistentry>
100 <term><option>-p</option></term>
101 <term><option>--priority=</option></term>
102
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>
120 </varlistentry>
121
122 <varlistentry>
123 <term><option>--level-prefix=</option></term>
124
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>&lt;5&gt;</literal> is logged at priority 5
129 (<literal>notice</literal>), and similar for the other
130 priority levels. Takes a boolean argument.</para></listitem>
131 </varlistentry>
132
133 </variablelist>
134
135 </refsect1>
136
137 <refsect1>
138 <title>Exit status</title>
139
140 <para>On success, 0 is returned, a non-zero failure code
141 otherwise.</para>
142 </refsect1>
143
144 <refsect1>
145 <title>Examples</title>
146
147 <example>
148 <title>Invoke a program</title>
149
150 <para>This calls <filename noindex='true'>/bin/ls</filename>
151 with standard output and error connected to the journal:</para>
152
153 <programlisting># systemd-cat ls</programlisting>
154 </example>
155
156 <example>
157 <title>Usage in a shell pipeline</title>
158
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>
162
163 <programlisting># ls | systemd-cat</programlisting>
164 </example>
165
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>
170 </refsect1>
171
172 <refsect1>
173 <title>See Also</title>
174 <para>
175 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
176 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
3ba3a79d 177 <citerefentry project='man-pages'><refentrytitle>logger</refentrytitle><manvolnum>1</manvolnum></citerefentry>
798d3a52
ZJS
178 </para>
179 </refsect1>
9aac0b2c
LP
180
181</refentry>