forked from pneymrl2f/nightingale
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
4 years ago | |
---|---|---|
.. | ||
ratelimiter | 4 years ago | |
util | 4 years ago | |
watch | 4 years ago | |
winfile | 4 years ago | |
.gitignore | 4 years ago | |
.travis.yml | 4 years ago | |
CHANGES.md | 4 years ago | |
Dockerfile | 4 years ago | |
LICENSE.txt | 4 years ago | |
Makefile | 4 years ago | |
README.md | 4 years ago | |
appveyor.yml | 4 years ago | |
tail.go | 4 years ago | |
tail_posix.go | 4 years ago | |
tail_windows.go | 4 years ago |
README.md
Go package for tail-ing files
A Go package striving to emulate the features of the BSD tail
program.
t, err := tail.TailFile("/var/log/nginx.log", tail.Config{Follow: true})
for line := range t.Lines {
fmt.Println(line.Text)
}
See API documentation.
Log rotation
Tail comes with full support for truncation/move detection as it is designed to work with log rotation tools.
Installing
go get github.com/hpcloud/tail/...
Windows support
This package needs assistance for full Windows support.