|
NAMEtinylog - log stdin to a directory of rotated log filesSYNOPSIStinylog [-hV] [-k numkeep ] [-r] [-s logsize ] [-t] [-z] dirDESCRIPTIONtinylog reads lines from standard input and writes them to a set of rotated log files maintained in dir.While active, tinylog switches into dir and writes into a log file named current. When current reaches the size specified with the -s option (default 100000 bytes), it rotates the file: current is renamed with a filename in the form _yyyymmddThhmmss.uuuuuu.s, and a new current is opened. tinylog maintains a set of older rotated log files in dir, upto the number specified with the -k option (default 5). After this number is reached, tinylog deletes the rotated log file with the oldest timestamp before continuing with a new current. If the -z option is specified, tinylog will compress log files during rotation with the utility specified in the environmental variable TINYLOG_ZIP (default /usr/bin/gzip). If the compression is successful, the rotated log file is renamed with a .Z extension. The name of a rotated log file may be described further: beginning with an underscore, followed by a current gmtime(3) timestamp in RFC8601 format (to the nearest microsecond), followed by a status suffix, and optionally followed by a .Z zip extension. Normally the status suffix is .s, indicating the file was safely written to disk. Otherwise a status suffix of .u indicates that the file was not safely written to disk, and may possibly be incomplete and/or corrupted by an unexpected failure. tinylog sets the file mode of current to 0644 while active. When tinylog sees eof on stdin, it writes any pending line to current, fsyncs and closes the file, and changes its mode to 0744 before exiting. Whenever tinylog restarts, it looks for an existing current and, if one is found with a file mode 0744, reopens it and changes its mode back to 0644 for continued logging. Otherwise, if an existing current is found set with a mode of 0644, it is immediately rotated with a .u suffix, and a new current is opened. tinylog ignores empty lines, truncates lines longer than 1000 characters, and converts unprintable control characters to `?'. OPTIONS
ENVIRONMENTTINYLOG_ZIPIf defined and the -z option is specified, will be
taken as the executable for the compression utility to use when rotating a log
file.
SIGNALStinylog traps the following signals for adminstrative control during runtime:SIGHUP Close and rotate current, then continue logging
with a new current.
SIGTERM Stop reading stdin, process any pending lines already
read, flush and close current safely to disk, then exit 0 (no error).
Stdin will be left at the first byte of any unprocessed data.
EXIT STATUStinylog exits with the following values:
Otherwise, after startup, tinylog tries very hard not to exit until eof is read on stdin. In the case of system or resource failures, tinylog will print a diagnostic message to stderr, pause for a brief interval, and then retry the failed operation. AUTHORWayne Marshall, http://b0llix.net/perp/SEE ALSOperp_intro(8), perpboot(8), perpctl(8), perpd(8), perpetrate(5), perphup(8), perpls(8), perpok(8), perpstat(8), sissylog(8)
Visit the GSP FreeBSD Man Page Interface. |