tail/README.md

28 lines
617 B
Markdown
Raw Normal View History

# Go package for tail-ing files
2012-10-13 00:05:11 +08:00
A Go package striving to emulate the features of the BSD `tail` program.
2012-10-13 00:05:11 +08:00
```Go
2013-02-06 10:49:32 +08:00
t, err := tail.TailFile("/var/log/nginx.log", tail.Config{Follow: true})
2012-10-13 00:05:11 +08:00
for line := range t.Lines {
fmt.Println(line.Text)
}
```
2013-03-11 06:01:42 +08:00
See [API documentation](http://godoc.org/github.com/ActiveState/tail).
2013-05-30 07:32:01 +08:00
## Log rotation
2013-05-30 07:32:01 +08:00
Tail comes with full support for truncation/move detection as it is
designed to work with log rotation tools.
2013-05-30 07:32:01 +08:00
## Installing
2013-05-30 07:32:01 +08:00
go get github.com/ActiveState/tail/...
2012-10-13 00:05:11 +08:00
## TODO
2013-05-30 07:32:01 +08:00
* Arbitrary values for `Location`
* `Location` could be specified in both lines and bytes metrics.