
WHAT IS IT?
===========

flog (file logger) is a program that reads input from STDIN
and writes to a file. if a SIGHUP is received, the file will be
reopened, allowing for log rotation [see logrotate(8) on RH.]
The log file will only be reopened if flog detects that
rotation has occurred (ie, old file gone or inode changed).
flog is very small (less than 500 bytes memory footprint.)


USAGE
=====

Typicall flog is used to log STDERR output from a daemon.
It's also very useful with Apache. This way you never have
to HUP apache itself:
	ErrorLog	"|/bin/flog /httpd/logs/error_log"

Typical example:
	(mydaemon >stdout.file) |& flog [-t] stderr.file

this will redirect daemon's STDOUT to a file called "stdout.file"
and STDERR (thru flog) to "stderr.file". (example uses zsh: the
best shell! like bash but better)

The -t option causes a timestamp to be prepended to each line.


FEATURES
========

if flog fills up a device (write returns ENOSPC), the log file
will be truncated back to 0 and restarted. (this is an emergency
avoidance feature only! always use logrotate to recycle logs)

send as many HUPs as you want to flog, when a HUP is caught,
the LOG will only be reopened if flog detects a logrotation.
(ie, inode changed, or file disappeard)

AUTHOR
======

Copyright (c) 2001 Fredrik Sjoholm <fredrik@sjoholm.com>
License: GPL - The GNU General Public License

