1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
<html><head><title>Output Channels - rsyslog.conf</title></head>
4
<p>This is a part of the rsyslog.conf documentation.</p>
5
<a href="rsyslog_conf.html">back</a>
6
<h2>Output Channels</h2>
7
<p>Output Channels are a new concept first introduced in rsyslog
8
0.9.0. <b>As of this writing, it is most likely that they will
9
be replaced by something different in the future.</b> So if you
10
use them, be prepared to change you configuration file syntax when you
11
upgrade to a later release.<br>
13
The idea behind output channel definitions is that it shall provide an
14
umbrella for any type of output that the user might want. In essence,<br>
15
this is the "file" part of selector lines (and this is why we are not
16
sure output channel syntax will stay after the next review). There is a<br>
17
difference, though: selector channels both have filter conditions
18
(currently facility and severity) as well as the output destination.
19
they can only be used to write to files - not pipes, ttys or whatever
20
Output channels define the output definition, only. As of this build,
21
else. If we stick with output channels, this will change over time.</p>
22
<p>In concept, an output channel includes everything needed to
23
know about an output actions. In practice, the current implementation
25
a filename, a maximum file size and a command to be issued when this
26
file size is reached. More things might be present in future version,
27
which might also change the syntax of the directive.</p>
28
<p>Output channels are defined via an $outchannel directive. It's
29
syntax is as follows:<br>
31
$outchannel name,file-name,max-size,action-on-max-size<br>
33
name is the name of the output channel (not the file), file-name is the
34
file name to be written to, max-size the maximum allowed size and
35
action-on-max-size a command to be issued when the max size is reached.
36
This command always has exactly one parameter. The binary is that part
37
of action-on-max-size before the first space, its parameter is
38
everything behind that space.<br>
40
Please note that max-size is queried BEFORE writing the log message to
41
the file. So be sure to set this limit reasonably low so that any
42
message might fit. For the current release, setting it 1k lower than
43
you expected is helpful. The max-size must always be specified in bytes
44
- there are no special symbols (like 1k, 1m,...) at this point of
47
Keep in mind that $outchannel just defines a channel with "name". It
48
does not activate it. To do so, you must use a selector line (see
49
below). That selector line includes the channel name plus an $ sign in
50
front of it. A sample might be:<br>
54
In its current form, output channels primarily provide the ability to
55
size-limit an output file. To do so, specify a maximum size. When this
56
size is reached, rsyslogd will execute the action-on-max-size command
57
and then reopen the file and retry. The command should be something
58
like a <a href="log_rotation_fix_size.html">log rotation
59
script</a> or a similar thing.</p>
60
<p>If there is no action-on-max-size command or the command did
61
not resolve the situation, the file is closed and never reopened by
62
rsyslogd (except, of course, by huping it). This logic was integrated
63
when we first experienced severe issues with files larger 2gb, which
64
could lead to rsyslogd dumping core. In such cases, it is more
65
appropriate to stop writing to a single file. Meanwhile, rsyslogd has
66
been fixed to support files larger 2gb, but obviously only on file
67
systems and operating system versions that do so. So it can still make
68
sense to enforce a 2gb file size limit.</p>
70
<p>[<a href="manual.html">manual index</a>]
71
[<a href="rsyslog_conf.html">rsyslog.conf</a>]
72
[<a href="http://www.rsyslog.com/">rsyslog site</a>]</p>
73
<p><font size="2">This documentation is part of the
74
<a href="http://www.rsyslog.com/">rsyslog</a> project.<br>
75
Copyright © 2008 by <a href="http://www.gerhards.net/rainer">Rainer Gerhards</a> and
76
<a href="http://www.adiscon.com/">Adiscon</a>. Released under the GNU GPL
77
version 2 or higher.</font></p>