tail/README.md

29 lines
883 B
Markdown
Raw Normal View History

[![Build Status](https://travis-ci.org/hpcloud/tail.svg)](https://travis-ci.org/hpcloud/tail)
2017-08-15 00:06:53 +08:00
[![Build status](https://ci.appveyor.com/api/projects/status/vrl3paf9md0a7bgk/branch/master?svg=true)](https://ci.appveyor.com/project/Nino-K/tail/branch/master)
2014-03-22 13:02:52 +08:00
# 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)
}
```
2015-09-30 22:48:17 +08:00
See [API documentation](http://godoc.org/github.com/hpcloud/tail).
2013-03-11 06:01:42 +08:00
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
2015-09-30 22:48:17 +08:00
go get github.com/hpcloud/tail/...
2015-07-04 07:19:37 +08:00
## Windows support
2015-09-30 22:48:17 +08:00
This package [needs assistance](https://github.com/hpcloud/tail/labels/Windows) for full Windows support.