Like Prometheus, but for logs.
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.
 
 
 
 
 
 
loki/vendor/github.com/hpcloud/tail
Ed Welch 94b9c4ba16
Improve how we record file size metric to avoid a race in our file lagging alert (#1194)
6 years ago
..
ratelimiter Updating hpcloud tail library to forked version modified for our purposes. 6 years ago
util Move promtail from kausalco/public, update it for prometheus changes. 7 years ago
watch Updating hpcloud tail library to forked version modified for our purposes. 6 years ago
winfile Move promtail from kausalco/public, update it for prometheus changes. 7 years ago
.gitignore Move promtail from kausalco/public, update it for prometheus changes. 7 years ago
.travis.yml Updating hpcloud tail library to forked version modified for our purposes. 6 years ago
CHANGES.md Move promtail from kausalco/public, update it for prometheus changes. 7 years ago
Dockerfile Move promtail from kausalco/public, update it for prometheus changes. 7 years ago
LICENSE.txt Move promtail from kausalco/public, update it for prometheus changes. 7 years ago
Makefile Move promtail from kausalco/public, update it for prometheus changes. 7 years ago
README.md updating the forked hpcloud/tail library to the fork maintained at github.com/grafana/tail 6 years ago
appveyor.yml Move promtail from kausalco/public, update it for prometheus changes. 7 years ago
tail.go Improve how we record file size metric to avoid a race in our file lagging alert (#1194) 6 years ago
tail_posix.go Updating hpcloud tail library to forked version modified for our purposes. 6 years ago
tail_windows.go Move promtail from kausalco/public, update it for prometheus changes. 7 years ago

README.md

NOTE: This fork is currently being maintained for use in the promtail agent of the Loki project.

Use outside of that context is not tested or supported.

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.