Main index | Section 1 | Options |
A fifolog can be stored either directly on a disk partition or in a regular file.
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.
The fifolog_create utility 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 once.
Running fifolog_create on an existing fifolog will reset it so that fifolog_reader and fifolog_writer 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.)
If the
file
does not already exist,
fifolog_create
will attempt to create and
ftruncate(2)
it to the specified size, defaulting to 86400 records of 512 bytes
if the
The fifolog_writer utility 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,
The second and slower timer,
The
The
fifolog_reader
utility
will retrieve records from the fifolog according to the specified
parameters and write them either to standard output or the file specified
with
It is possible to specify a start and end time to limit the amount
of data
fifolog_reader
will report.
The lower-case variants
The
Finally, records can be filtered such that only records matching the
( REG_BASIC)
regular expression specified with
The exact encoding is described in the fifolog.h file.
Fifolog is particularly well suited for use on Flash based media, where it results in much lower write-wear, than a file system with regular log files rotated with newsyslog(8) etc.
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 fifolog_writer is with syslogd(8) using a line such as this in syslog.conf(5):
*.* |fifolog_writer /var/log/syslog_fifolog
FIFOLOG (1) | February 9, 2008 |
Main index | Section 1 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.