Fifologs provide a compact round-robin circular storage for
recording text and binary information to permanent storage in a bounded
and predictable fashion, time and space wise.
A fifolog can be stored either directly on a disk partition or in a
The input data stream is encoded, compressed and marked up with
timestamps before it is written to storage, such that it is possible
to seek out a particular time interval in the stored data, without
having to decompress the entire logfile.
is used to initialize the first sector of a disk device
or file system file to make it a fifolog and should be called only
on an existing fifolog will reset it so that
will not see the previous contents.
(The previous contents are not physically erased, and with a bit
of hand-work all but the first record can be easily recovered.)
does not already exist,
will attempt to create and
it to the specified size, defaulting to 86400 records of 512 bytes
-r -, -l
options do not specify otherwise.
will read standard input and write it to the end of the fifolog
according to the parameters given.
Writes happen whenever the output buffer is filled with compressed
data or when either of two timers expire, forcing a partially filled
buffer to be written.
The first and faster timer,
forces available data to be written
but does not flush and reset the compression dictionary.
This timer is intended to minimize the amount of logdata lost in RAM
in case of a crash and by default it fires 10 seconds after
the previous write.
The second and slower timer,
forces a full flush and reset of the compression
engine and causes the next record written to be a synchronization
point with an uncompressed timestamp, making it possible to start
reading the logfile from that record.
By default this timer fires a minute after the previous sync.
option controls the
compression level; legal values are zero to nine which is the default.
will retrieve records from the fifolog according to the specified
parameters and write them either to standard output or the file specified
It is possible to specify a start and end time to limit the amount
The lower-case variants
value, whereas the upper-case variants
take human-readable specifications such as
"1 hour ago".
option forces timestamps to be formatted as
instead of as
.Vt time_t ,
allows the specification of an
Finally, records can be filtered such that only records matching the
regular expression specified with
Create a fifolog with 1024*1024 records of 512 bytes:
fifolog_create -r 10m /tmp/fifolog
Write a single record to this file:
date | fifolog_writer /tmp/fifolog
Read it back with human readable timestamps:
fifolog_reader -t /tmp/fifolog
One particular useful use of
using a line such as this in
*.* |fifolog_writer /var/log/syslog_fifolog