]> git.proxmox.com Git - systemd.git/blob - man/systemd-cat.html
Imported Upstream version 220
[systemd.git] / man / systemd-cat.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>systemd-cat</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
2 a.headerlink {
3 color: #c60f0f;
4 font-size: 0.8em;
5 padding: 0 4px 0 4px;
6 text-decoration: none;
7 visibility: hidden;
8 }
9
10 a.headerlink:hover {
11 background-color: #c60f0f;
12 color: white;
13 }
14
15 h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
16 visibility: visible;
17 }
18 </style><a href="index.html">Index </a>·
19 <a href="systemd.directives.html">Directives </a>·
20 <a href="../python-systemd/index.html">Python </a>·
21 <a href="../libudev/index.html">libudev </a>·
22 <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 220</span><hr><div class="refentry"><a name="systemd-cat"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>systemd-cat — Connect a pipeline or program's output with the journal</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">systemd-cat [OPTIONS...] [COMMAND] [ARGUMENTS...]</code> </p></div><div class="cmdsynopsis"><p><code class="command">systemd-cat [OPTIONS...]</code> </p></div></div><div class="refsect1"><a name="idm139623677964752"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description"></a></h2><p><span class="command"><strong>systemd-cat</strong></span> may be used to connect the
23 standard input and output of a process to the journal, or as a
24 filter tool in a shell pipeline to pass the output the previous
25 pipeline element generates to the journal.</p><p>If no parameter is passed, <span class="command"><strong>systemd-cat</strong></span>
26 will write everything it reads from standard input (stdin) to the
27 journal.</p><p>If parameters are passed, they are executed as command line
28 with standard output (stdout) and standard error output (stderr)
29 connected to the journal, so that all it writes is stored in the
30 journal.</p></div><div class="refsect1"><a name="idm139623677961264"></a><h2 id="Options">Options<a class="headerlink" title="Permalink to this headline" href="#Options"></a></h2><p>The following options are understood:</p><div class="variablelist"><dl class="variablelist"><dt id="-h"><span class="term"><code class="option">-h</code>, </span><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#-h"></a></dt><dd><p><a name="help-text"></a>Print a short help text and exit.
31 </p></dd><dt id="--version"><span class="term"><code class="option">--version</code></span><a class="headerlink" title="Permalink to this term" href="#--version"></a></dt><dd><p><a name="version-text"></a>Print a short version string and exit.</p></dd><dt id="-t"><span class="term"><code class="option">-t</code>, </span><span class="term"><code class="option">--identifier=</code></span><a class="headerlink" title="Permalink to this term" href="#-t"></a></dt><dd><p>Specify a short string that is used to
32 identify the logging tool. If not specified, no identification
33 string is written to the journal.</p></dd><dt id="-p"><span class="term"><code class="option">-p</code>, </span><span class="term"><code class="option">--priority=</code></span><a class="headerlink" title="Permalink to this term" href="#-p"></a></dt><dd><p>Specify the default priority level for the
34 logged messages. Pass one of
35 "<code class="literal">emerg</code>",
36 "<code class="literal">alert</code>",
37 "<code class="literal">crit</code>",
38 "<code class="literal">err</code>",
39 "<code class="literal">warning</code>",
40 "<code class="literal">notice</code>",
41 "<code class="literal">info</code>",
42 "<code class="literal">debug</code>", or a
43 value between 0 and 7 (corresponding to the same named
44 levels). These priority values are the same as defined by
45 <a href="http://man7.org/linux/man-pages/man3/syslog.3.html"><span class="citerefentry"><span class="refentrytitle">syslog</span>(3)</span></a>.
46 Defaults to "<code class="literal">info</code>". Note that this simply
47 controls the default, individual lines may be logged with
48 different levels if they are prefixed accordingly. For details
49 see <code class="option">--level-prefix=</code> below.</p></dd><dt id="--level-prefix="><span class="term"><code class="option">--level-prefix=</code></span><a class="headerlink" title="Permalink to this term" href="#--level-prefix="></a></dt><dd><p>Controls whether lines read are parsed for
50 syslog priority level prefixes. If enabled (the default), a
51 line prefixed with a priority prefix such as
52 "<code class="literal">&lt;5&gt;</code>" is logged at priority 5
53 ("<code class="literal">notice</code>"), and similar for the other
54 priority levels. Takes a boolean argument.</p></dd></dl></div></div><div class="refsect1"><a name="idm139623677943840"></a><h2 id="Exit status">Exit status<a class="headerlink" title="Permalink to this headline" href="#Exit%20status"></a></h2><p>On success, 0 is returned, a non-zero failure code
55 otherwise.</p></div><div class="refsect1"><a name="idm139623677942688"></a><h2 id="Examples">Examples<a class="headerlink" title="Permalink to this headline" href="#Examples"></a></h2><div class="example"><a name="idm139623677942048"></a><p class="title"><b>Example 1. Invoke a program</b></p><div class="example-contents"><p>This calls <code class="filename">/bin/ls</code>
56 with standard output and error connected to the journal:</p><pre class="programlisting"># systemd-cat ls</pre></div></div><br class="example-break"><div class="example"><a name="idm139623677939408"></a><p class="title"><b>Example 2. Usage in a shell pipeline</b></p><div class="example-contents"><p>This builds a shell pipeline also invoking
57 <code class="filename">/bin/ls</code> and writes the output it generates
58 to the journal:</p><pre class="programlisting"># ls | systemd-cat</pre></div></div><br class="example-break"><p>Even though the two examples have very similar effects the
59 first is preferable since only one process is running at a time,
60 and both stdout and stderr are captured while in the second
61 example, only stdout is captured.</p></div><div class="refsect1"><a name="idm139623677936256"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
62 <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
63 <a href="systemctl.html"><span class="citerefentry"><span class="refentrytitle">systemctl</span>(1)</span></a>,
64 <a href="http://man7.org/linux/man-pages/man1/logger.1.html"><span class="citerefentry"><span class="refentrytitle">logger</span>(1)</span></a>
65 </p></div></div></body></html>