logtee

command module
v0.0.0-...-3609a9e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 8 Imported by: 0

README

logtee

Logtee is a tool for writing a stream of log lines into rolling log files, optionally with compression.

Technically, logtee is just a small CLI wrapper for the fantastic https://github.com/DeRuina/timberjack library.

Installation

go install github.com/cvilsmeier/logtee@latest

Usage

Usage:

  logtee [options...]

Options:

  -c string
    	File compression mode: 'none'|'gzip'|'zstd'. (default "gzip")
  -f string
    	Filename to write logs to. (default "out.log")
  -n int
    	Max. backup files file size in MB. (default 10)
  -s int
    	Max. file size in MB. (default 100)
  -stdout
    	Write stdout also. Might be useful for debugging.

Examples:

  myprogram | logtee

    This command runs myprogram, pipes its stdout to logtee, which
    then writes all output to out.log. When out.log grows beyond
    100 MB, it gets 'gzip' compressed and moved to a timestamped
    backup file. The default settings keep 10 backup files, old
    files are deleted.

  myprogram | logtee -f my.log -s 20 -n 30 

    Same as above, but the file is my.log (instead of out.log), the
    max. file size is 20 MB (instead of 100 MB) and the max. number
    of backup files is 30 (instead of 10).

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL