名称 最后更新
..
ratelimiter 正在载入提交数据...
util 正在载入提交数据...
watch 正在载入提交数据...
winfile 正在载入提交数据...
.gitignore 正在载入提交数据...
.travis.yml 正在载入提交数据...
CHANGES.md 正在载入提交数据...
Dockerfile 正在载入提交数据...
LICENSE 正在载入提交数据...
README.md 正在载入提交数据...
appveyor.yml 正在载入提交数据...
go.mod 正在载入提交数据...
tail.go 正在载入提交数据...
tail_posix.go 正在载入提交数据...
tail_windows.go 正在载入提交数据...

Build Status

This is repo is forked from the dormant upstream repo at hpcloud. This fork adds support for go modules, updates the dependencies, adds features and fixes bugs. Go 1.9 is the oldest compiler release supported.

Go package for tail-ing files

A Go package striving to emulate the features of the BSD tail program.

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

for line := range t.Lines {
    fmt.Println(line.Text)
}

See API documentation.

Log rotation

Tail comes with full support for truncation/move detection as it is designed to work with log rotation tools.

Installing

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

Windows support

This package needs assistance for full Windows support.