github.com/grafana/tail@v0.0.0-20230510142333-77b18831edf0/README.md (about) 1 2 **NOTE**: This fork is currently being maintained for use in the promtail agent of the [Loki](https://github.com/grafana/loki) project. 3 4 Use outside of that context is not tested or supported. 5 6 # Go package for tail-ing files 7 8 A Go package striving to emulate the features of the BSD `tail` program. 9 10 ```Go 11 t, err := tail.TailFile("/var/log/nginx.log", tail.Config{Follow: true}) 12 for line := range t.Lines { 13 fmt.Println(line.Text) 14 } 15 ``` 16 17 See [API documentation](http://godoc.org/github.com/hpcloud/tail). 18 19 ## Log rotation 20 21 Tail comes with full support for truncation/move detection as it is 22 designed to work with log rotation tools. 23 24 ## Installing 25 26 go get github.com/hpcloud/tail/... 27 28 ## Windows support 29 30 This package [needs assistance](https://github.com/hpcloud/tail/labels/Windows) for full Windows support.