1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52
from filter on 25 November 2000 -->
<TITLE>Exim Filter Specification - Logging commands</TITLE>
</HEAD>
<body bgcolor="#FFFFFF" text="#00005A" link="#FF6600" alink="#FF9933" vlink="#990000">
Go to the <A HREF="filter_1.html">first</A>, <A HREF="filter_16.html">previous</A>, <A HREF="filter_18.html">next</A>, <A HREF="filter_34.html">last</A> section, <A HREF="filter_toc.html">table of contents</A>.
<P><HR><P>
<H2><A NAME="SEC17" HREF="filter_toc.html#TOC17">Logging commands</A></H2>
<P>
A log can be kept of actions taken by a filter file. This facility is normally
available in conventional configurations, but there are some situations where
it might not be. Also, the system administrator may choose to disable it. Check
your local information if in doubt.
</P>
<P>
Logging takes place while the filter file is being interpreted. It does not
queue up for later like the delivery commands. The reason for this is so that a
log file need be opened only once for several write operations. There are two
commands, neither of which constitutes a significant delivery. The first
defines a file to which logging output is subsequently written:
<PRE>
logfile <<EM>file name</EM>>
e.g. logfile $home/filter.log
</PRE>
<P>
The file name may optionally be followed by a mode for the file, which is used
if the file has to be created. For example,
<PRE>
logfile $home/filter.log 0644
</PRE>
<P>
The number is interpreted as octal, even if it does not begin with a zero.
The default for the mode is 600. It is suggested that the <EM>logfile</EM> command
normally appear as the first command in a filter file. Once <EM>logfile</EM> has been
obeyed, the <EM>logwrite</EM> command can be used to write to the log file:
<PRE>
logwrite "<<EM>some text string</EM>>"
e.g. logwrite "$tod_log $message_id processed"
</PRE>
<P>
It is possible to have more than one <EM>logfile</EM> command, to specify writing to
different log files in different circumstances. Writing takes place at the end
of the file, and a newline character is added to the end of each string if
there isn't one already there. Newlines can be put in the middle of the string
by using the `\n' escape sequence. Lines from simultaneous deliveries may get
interleaved in the file, as there is no interlocking, so you should plan your
logging with this in mind. However, data should not get lost.
</P>
<P>
In earlier versions of Exim the <EM>logwrite</EM> command was called <EM>log</EM>, and this
name remains available for backwards compatibility. However, it is not possible
to use the name <EM>log</EM> as a command name following a <EM>mail</EM> command, because it
will be interpreted as the <EM>log</EM> option of that command.
</P>
<P><HR><P>
Go to the <A HREF="filter_1.html">first</A>, <A HREF="filter_16.html">previous</A>, <A HREF="filter_18.html">next</A>, <A HREF="filter_34.html">last</A> section, <A HREF="filter_toc.html">table of contents</A>.
</BODY>
</HTML>
|