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.
 
 
 
Dennis Jekubczyk bd08f3443a vendor dependencies 3 years ago
..
ratelimiter vendor dependencies 3 years ago
util vendor dependencies 3 years ago
watch vendor dependencies 3 years ago
winfile vendor dependencies 3 years ago
.gitignore vendor dependencies 3 years ago
CHANGES.md vendor dependencies 3 years ago
Dockerfile vendor dependencies 3 years ago
LICENSE vendor dependencies 3 years ago
README.md vendor dependencies 3 years ago
go.mod vendor dependencies 3 years ago
go.sum vendor dependencies 3 years ago
tail.go vendor dependencies 3 years ago
tail_posix.go vendor dependencies 3 years ago
tail_windows.go vendor dependencies 3 years ago

README.md

ciGo Reference

tail functionality in Go

nxadm/tail provides a Go library that emulates the features of the BSD tail program. The library comes with full support for truncation/move detection as it is designed to work with log rotation tools. The library works on all operating systems supported by Go, including POSIX systems like Linux and *BSD, and MS Windows. Go 1.9 is the oldest compiler release supported.

A simple example:

// Create a tail
t, err := tail.TailFile(
	"/var/log/nginx.log", tail.Config{Follow: true, ReOpen: true})
if err != nil {
    panic(err)
}

// Print the text of each received line
for line := range t.Lines {
    fmt.Println(line.Text)
}

See API documentation.

Installing

go get github.com/nxadm/tail/...

History

This project is an active, drop-in replacement for the abandoned Go tail library at hpcloud. Next to addressing open issues/PRs of the original project, nxadm/tail continues the development by keeping up to date with the Go toolchain (e.g. go modules) and dependencies, completing the documentation, adding features and fixing bugs.

Examples

Examples, e.g. used to debug an issue, are kept in the examples directory.