systemd-cat.xml revision 5430f7f2bc7330f3088b894166bf3524a067e3d8
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering<?xml version='1.0'?> <!--*-nxml-*-->
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering<!--
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering This file is part of systemd.
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
44f44a29cc1346c0783d679374ce98d81bf6400cLennart Poettering Copyright 2012 Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering systemd is free software; you can redistribute it and/or modify it
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering under the terms of the GNU Lesser General Public License as published by
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering (at your option) any later version.
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering systemd is distributed in the hope that it will be useful, but
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering Lesser General Public License for more details.
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering You should have received a copy of the GNU Lesser General Public License
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering-->
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering<refentry id="systemd-cat">
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <refentryinfo>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <title>systemd-cat</title>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <productname>systemd</productname>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <authorgroup>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <author>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <contrib>Developer</contrib>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <firstname>Lennart</firstname>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <surname>Poettering</surname>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <email>lennart@poettering.net</email>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering </author>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering </authorgroup>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering </refentryinfo>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <refmeta>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <refentrytitle>systemd-cat</refentrytitle>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <manvolnum>1</manvolnum>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering </refmeta>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <refnamediv>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <refname>systemd-cat</refname>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <refpurpose>Connect a pipeline or program's output with the journal</refpurpose>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering </refnamediv>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <refsynopsisdiv>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <cmdsynopsis>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <command>systemd-cat <arg choice="opt" rep="repeat">OPTIONS</arg> <arg>COMMAND</arg> <arg choice="opt" rep="repeat">ARGUMENTS</arg></command>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering </cmdsynopsis>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <cmdsynopsis>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <command>systemd-cat <arg choice="opt" rep="repeat">OPTIONS</arg></command>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering </cmdsynopsis>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering </refsynopsisdiv>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <refsect1>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <title>Description</title>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <para><command>systemd-cat</command> may be used to
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering connect STDOUT and STDERR of a process with the
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering journal, or as a filter tool in a shell pipeline to
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering pass the output the previous pipeline element
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering generates to the journal.</para>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <para>If no parameter is passed
9adf646d0ae85192027319e2f47f2d092a298d99Lennart Poettering <command>systemd-cat</command> will write
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering everything it reads from standard input (STDIN) to the journal.</para>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <para>If parameters are passed they are executed as
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering command line with standard output (STDOUT) and standard
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering error output (STDERR) connected to the journal, so
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering that all it writes is stored in the journal.</para>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering </refsect1>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <refsect1>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <title>Options</title>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <para>The following options are understood:</para>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <variablelist>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <varlistentry>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <term><option>--h</option></term>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <term><option>--help</option></term>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <listitem><para>Prints a short help
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering text and exits.</para></listitem>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering </varlistentry>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <varlistentry>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <term><option>--version</option></term>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <listitem><para>Prints a short version
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering string and exits.</para></listitem>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering </varlistentry>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <varlistentry>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <term><option>-t</option></term>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <term><option>--identifier=</option></term>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <listitem><para>Specify a short string
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering that is used to identify the logging
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering tool. If not specified no identifying
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering string is written to the journal.</para></listitem>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering </varlistentry>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <varlistentry>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <term><option>-p</option></term>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <term><option>--priority=</option></term>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <listitem><para>Specify the default
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering priority level for the logged
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering messages. Pass one of
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <literal>emerg</literal>,
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <literal>alert</literal>,
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <literal>crit</literal>,
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <literal>err</literal>,
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <literal>warning</literal>,
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <literal>notice</literal>,
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <literal>info</literal>,
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <literal>debug</literal>, resp. a
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering value between 0 and 7 (corresponding
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering to the same named levels). These
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering priority values are the same as
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering defined by
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <citerefentry><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>. Defaults
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering to <literal>info</literal>. Note that
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering this simply controls the default,
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering individual lines may be logged with
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering different levels if they are prefixed
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering accordingly. For details see
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <option>--level-prefix=</option>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering below.</para></listitem>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering </varlistentry>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <varlistentry>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <term><option>--level-prefix=</option></term>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <listitem><para>Controls whether lines
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering read are parsed for syslog priority
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering level prefixes. If enabled (the
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering default) a line prefixed with a
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering priority prefix such as
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <literal>&lt;5&gt;</literal> is logged
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering at priority 5
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering (<literal>notice</literal>), and
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering similar for the other priority
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering levels. Takes a boolean
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering argument.</para></listitem>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering </varlistentry>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering </variablelist>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering </refsect1>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <refsect1>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <title>Exit status</title>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <para>On success 0 is returned, a non-zero failure
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering code otherwise.</para>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering </refsect1>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <refsect1>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <title>Examples</title>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <example>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <title>Invoke a program</title>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <para>This calls <filename>/bin/ls</filename>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering with STDOUT/STDERR connected to the
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering journal:</para>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <programlisting># systemd-cat ls</programlisting>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering </example>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <example>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <title>Usage in a shell pipeline</title>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <para>This builds a shell pipeline also
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering invoking <filename>/bin/ls</filename> and
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering writes the output it generates to the
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering journal:</para>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <programlisting># ls | systemd-cat</programlisting>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering </example>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <para>Even though the two examples have very similar
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering effects the first is preferable since only one process
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering is running at a time, and both STDOUT and STDERR are
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering captured while in the second example only STDOUT is
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering captured.</para>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering </refsect1>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <refsect1>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <title>See Also</title>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <para>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering <citerefentry><refentrytitle>logger</refentrytitle><manvolnum>1</manvolnum></citerefentry>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering </para>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering </refsect1>
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering
9aac0b2c19c558b853da7a6d67a0929b2d44dee4Lennart Poettering</refentry>