From afa7fd8b12566ddba843a4ed6d31183354cfb724 Mon Sep 17 00:00:00 2001 From: Tommaso Visconti Date: Sun, 21 Mar 2021 17:04:36 +0100 Subject: [PATCH] Add instructions to make it work with Windows --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ed8bd9ac..af4f5d1e 100644 --- a/README.md +++ b/README.md @@ -25,4 +25,13 @@ designed to work with log rotation tools. ## Windows support -This package [needs assistance](https://github.com/hpcloud/tail/labels/Windows) for full Windows support. +If the above example doesn't work for you, try replacing fsnotify method with polling: + +```Go +t, err := tail.TailFile("/var/log/nginx.log", tail.Config{Follow: true, Poll: true}) +for line := range t.Lines { + fmt.Println(line.Text) +} +``` + +For further assistance on Windows support, [check the windows-labeled issues](https://github.com/hpcloud/tail/labels/Windows).