Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nxadm/tail
[Revamped] Go package for reading from continuously updated files (tail -f)
https://github.com/nxadm/tail
go golang logging monitoring tail trigger watcher
Last synced: 3 days ago
JSON representation
[Revamped] Go package for reading from continuously updated files (tail -f)
- Host: GitHub
- URL: https://github.com/nxadm/tail
- Owner: nxadm
- License: mit
- Created: 2018-10-22T12:47:59.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-24T11:45:20.000Z (6 months ago)
- Last Synced: 2025-01-15T07:17:13.949Z (11 days ago)
- Topics: go, golang, logging, monitoring, tail, trigger, watcher
- Language: Go
- Homepage:
- Size: 3.81 MB
- Stars: 354
- Watchers: 8
- Forks: 67
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-golang-repositories - tail - f) (Repositories)
README
[![Go Reference](https://pkg.go.dev/badge/github.com/nxadm/tail.svg)](https://pkg.go.dev/github.com/nxadm/tail#section-documentation)
![ci](https://github.com/nxadm/tail/workflows/ci/badge.svg)
[![FreeBSD](https://api.cirrus-ci.com/github/nxadm/tail.svg)](https://cirrus-ci.com/github/nxadm/tail)
# tail functionality in Gonxadm/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, *BSD,
MacOS, and MS Windows. Go 1.12 is the oldest compiler release supported.A simple example:
```Go
// 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](https://pkg.go.dev/github.com/nxadm/tail#section-documentation).
## Installing
go get github.com/nxadm/tail/...
## History
This project is an active, drop-in replacement for the
[abandoned](https://en.wikipedia.org/wiki/HPE_Helion) Go tail library at
[hpcloud](https://github.com/hpcloud/tail). Next to
[addressing open issues/PRs of the original project](https://github.com/nxadm/tail/issues/6),
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](/examples).