systemd/man/systemd-cat.html
2015-02-17 11:22:16 +01:00

66 lines
7.0 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<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>
a.headerlink {
color: #c60f0f;
font-size: 0.8em;
padding: 0 4px 0 4px;
text-decoration: none;
visibility: hidden;
}
a.headerlink:hover {
background-color: #c60f0f;
color: white;
}
h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
visibility: visible;
}
</style><a href="index.html">Index </a>·
<a href="systemd.directives.html">Directives </a>·
<a href="../python-systemd/index.html">Python </a>·
<a href="../libudev/index.html">libudev </a>·
<a href="../libudev/index.html">gudev </a><span style="float:right">systemd 219</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="idm140112550225264"></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
standard input and output of a process to the journal, or as a
filter tool in a shell pipeline to pass the output the previous
pipeline element generates to the journal.</p><p>If no parameter is passed, <span class="command"><strong>systemd-cat</strong></span>
will write everything it reads from standard input (stdin) to the
journal.</p><p>If parameters are passed, they are executed as command line
with standard output (stdout) and standard error output (stderr)
connected to the journal, so that all it writes is stored in the
journal.</p></div><div class="refsect1"><a name="idm140112546434240"></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.
</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
identify the logging tool. If not specified, no identification
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
logged messages. Pass one of
"<code class="literal">emerg</code>",
"<code class="literal">alert</code>",
"<code class="literal">crit</code>",
"<code class="literal">err</code>",
"<code class="literal">warning</code>",
"<code class="literal">notice</code>",
"<code class="literal">info</code>",
"<code class="literal">debug</code>", or a
value between 0 and 7 (corresponding to the same named
levels). These priority values are the same as defined by
<a href="http://man7.org/linux/man-pages/man3/syslog.3.html"><span class="citerefentry"><span class="refentrytitle">syslog</span>(3)</span></a>.
Defaults to "<code class="literal">info</code>". Note that this simply
controls the default, individual lines may be logged with
different levels if they are prefixed accordingly. For details
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
syslog priority level prefixes. If enabled (the default), a
line prefixed with a priority prefix such as
"<code class="literal">&lt;5&gt;</code>" is logged at priority 5
("<code class="literal">notice</code>"), and similar for the other
priority levels. Takes a boolean argument.</p></dd></dl></div></div><div class="refsect1"><a name="idm140112550319440"></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
otherwise.</p></div><div class="refsect1"><a name="idm140112550318256"></a><h2 id="Examples">Examples<a class="headerlink" title="Permalink to this headline" href="#Examples"></a></h2><div class="example"><a name="idm140112550317584"></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>
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="idm140112550314720"></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
<code class="filename">/bin/ls</code> and writes the output it generates
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
first is preferable since only one process is running at a time,
and both stdout and stderr are captured while in the second
example, only stdout is captured.</p></div><div class="refsect1"><a name="idm140112550311392"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
<a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
<a href="systemctl.html"><span class="citerefentry"><span class="refentrytitle">systemctl</span>(1)</span></a>,
<a href="logger.html"><span class="citerefentry"><span class="refentrytitle">logger</span>(1)</span></a>
</p></div></div></body></html>