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.)
does not already exist,
will attempt to create and
it to the specified size, defaulting to 86400 records of 512 bytes
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,
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
Finally, records can be filtered such that only records matching the
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
*.* |fifolog_writer /var/log/syslog_fifolog
|February 9, 2008