• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/H07-Feb-2021-

cmd/gotail/H07-Feb-2021-

examples/H07-Feb-2021-

ratelimiter/H07-Feb-2021-

util/H07-Feb-2021-

vendor/H03-May-2022-

watch/H07-Feb-2021-

winfile/H07-Feb-2021-

.gitignoreH A D07-Feb-202125

CHANGES.mdH A D07-Feb-20211.6 KiB

DockerfileH A D07-Feb-2021473

LICENSEH A D07-Feb-20211.1 KiB

README.mdH A D07-Feb-20211.5 KiB

go.modH A D07-Feb-2021141

go.sumH A D07-Feb-2021589

tail.goH A D07-Feb-202111.4 KiB

tail_posix.goH A D07-Feb-2021463

tail_test.goH A D07-Feb-202119.5 KiB

tail_windows.goH A D07-Feb-2021521

README.md

1![ci](https://github.com/nxadm/tail/workflows/ci/badge.svg)[![Go Reference](https://pkg.go.dev/badge/github.com/nxadm/tail.svg)](https://pkg.go.dev/github.com/nxadm/tail)
2
3# tail functionality in Go
4
5nxadm/tail provides a Go library that emulates the features of the BSD `tail`
6program. The library comes with full support for truncation/move detection as
7it is designed to work with log rotation tools. The library works on all
8operating systems supported by Go, including POSIX systems like Linux and
9*BSD, and MS Windows. Go 1.9 is the oldest compiler release supported.
10
11A simple example:
12
13```Go
14// Create a tail
15t, err := tail.TailFile(
16	"/var/log/nginx.log", tail.Config{Follow: true, ReOpen: true})
17if err != nil {
18    panic(err)
19}
20
21// Print the text of each received line
22for line := range t.Lines {
23    fmt.Println(line.Text)
24}
25```
26
27See [API documentation](https://pkg.go.dev/github.com/nxadm/tail).
28
29## Installing
30
31    go get github.com/nxadm/tail/...
32
33## History
34
35This project is an active, drop-in replacement for the
36[abandoned](https://en.wikipedia.org/wiki/HPE_Helion) Go tail library at
37[hpcloud](https://github.com/hpcloud/tail). Next to
38[addressing open issues/PRs of the original project](https://github.com/nxadm/tail/issues/6),
39nxadm/tail continues the development by keeping up to date with the Go toolchain
40(e.g. go modules) and dependencies, completing the documentation, adding features
41and fixing bugs.
42
43## Examples
44Examples, e.g. used to debug an issue, are kept in the [examples directory](/examples).