Commit Graph

82 Commits

Author SHA1 Message Date
Sridhar Ratnakumar 8d9c6e4ce1 allow seeking from beginning and end 2013-08-09 14:42:51 -07:00
Sridhar Ratnakumar 1e2bc8afe8 support arbitrary values for `Location` 2013-07-12 15:30:31 -07:00
Sridhar Ratnakumar 6af3d03d43 typo 2013-07-11 18:36:12 -07:00
Sridhar Ratnakumar b2509e165e option to limit the rate of reading lines from files 2013-07-11 17:28:18 -07:00
Sridhar Ratnakumar f461ddc97d support Follow=false 2013-05-30 13:18:46 -07:00
Sridhar Ratnakumar 92ad722d56 update readme, comments; gofmt 2013-05-29 16:32:01 -07:00
Sridhar Ratnakumar 499e541b19 copytruncate should work even if ReOpen is False.
at least, `tail -f` (not `tail -F` which is analogous to ReOpen)
reopens truncated files.

this change introduces the FileChanges struct to abstract the change
notifications for file changes, deletions and truncations.
2013-05-29 14:32:59 -07:00
Sridhar Ratnakumar d3c80d385d refactor code for upcoming changes to tail.go 2013-05-29 13:57:02 -07:00
Sridhar Ratnakumar 2cddd48e0a clean up ChangeEvents' goroutines upon tail.Stop 2013-05-29 11:35:27 -07:00
Sridhar Ratnakumar 7599e3efb9 fix tail.Stop blocking when called in midst of re-opening
this is what caused the test to hang occasionally. after this fix,
test completes in 2mins all the time.

closes issue #4
2013-05-28 19:35:12 -07:00
Sridhar Ratnakumar 0f67bc352f make watch.go its own package
for the purpose for upcoming changes to the watch functionality.
2013-05-28 16:37:21 -07:00
Sridhar Ratnakumar 976fc15b81 update change log, gofmt and remove debug prints 2013-05-28 14:01:32 -07:00
Sridhar Ratnakumar 644891ebbc BlockUntilExists should return immediately if the file already exists
this fixes a potential race condition in the use of BlockUntilExists
following a file existence check (as we do in tail.go:reopen).

closes issue 5
2013-05-28 13:29:40 -07:00
Sridhar Ratnakumar fb37e0b7ca use a smaller poll duration for faster test runs 2013-05-28 12:55:11 -07:00
Florian Weingarten 1ff299bc29 Add support for file truncation in InotifyFileWatcher
(cherry picked from commit 9de77aad8caca8102e7dd7c936d00ca3f0421ca7)
2013-05-28 11:59:03 -07:00
Sridhar Ratnakumar c5073c7f26 PollingFileWatcher.ChangeEvents must detect file deletion/rename 2013-05-27 15:34:50 -07:00
Sridhar Ratnakumar bf1dd37666 fix comments for godoc 2013-03-10 15:17:00 -07:00
Sridhar Ratnakumar 0449e85ca5 add license and copyright 2013-01-07 12:54:49 -08:00
Sridhar Ratnakumar 2384ff6374 avoid unnecessary inotify warning 2012-11-27 11:11:10 -08:00
Sridhar Ratnakumar 683e11c27d expose the time object to allow custom formatting
ref - http://bugs.activestate.com/show_bug.cgi?id=96009
2012-10-29 19:53:48 -07:00
Sridhar Ratnakumar b8bf75b80a MaxLineSize now splits longer lines without discarding the rest
implements http://bugs.activestate.com/show_bug.cgi?id=95745
2012-10-13 12:50:27 -07:00
Sridhar Ratnakumar df3f97310f test: fixture workflow to make test functions concise 2012-10-13 11:44:47 -07:00
Sridhar Ratnakumar 4e53f618e2 first test case for tail
tests "-n -1"

need to abstract operations for multiple workflow
2012-10-13 11:20:04 -07:00
Sridhar Ratnakumar 507783a4a0 allow gotail to accept multiple files
also rename cmd/tail to cmd/gotail
2012-10-12 17:28:04 -07:00
Sridhar Ratnakumar 048bbf8933 introduce tail command; fix tomb blocking after Kill 2012-10-12 17:14:35 -07:00
Sridhar Ratnakumar 4bbf3d28cc gracefully manage goroutines death using tomb
http://blog.labix.org/2011/10/09/death-of-goroutines-under-control
2012-10-12 16:28:22 -07:00
Sridhar Ratnakumar 187dea7196 use struct to configure the growing tail args; start working on unit tests 2012-10-12 14:32:04 -07:00
Sridhar Ratnakumar 74f84016b8 close the inotify watcher when returning
might fix http://bugs.activestate.com/show_bug.cgi?id=95803#c12
2012-10-12 07:09:36 -07:00
Sridhar Ratnakumar 5c84486ca3 check the stop channel while waiting on inotify
fixes http://bugs.activestate.com/show_bug.cgi?id=95718#c3
2012-10-11 21:47:58 -07:00
Sridhar Ratnakumar 3ff602e781 Bug #95803 - reduce cpu usage due to frequent polling
* use inotify for system log aggregation
* continue using polling for app log aggregation (overlayfs bug)
  * but increase wait time to 250ms

Squashed commit of the following:

commit 8ccd0359e559472be0066ad889ac1772e13ff20b
Author: Sridhar Ratnakumar <sridharr@activestate.com>
Date:   Thu Oct 11 21:28:41 2012 -0700

    complete the polling watcher

commit 0a5d5aa488e96aa247c7c88c25cd5a30219f5344
Author: Sridhar Ratnakumar <sridharr@activestate.com>
Date:   Thu Oct 11 20:50:08 2012 -0700

    hackish, untested, incomplete implementation of pollig filewatcher

    .. to be tested on macbook.

commit c7ac3851452ed23a8b099773cc9c9f23734a89f5
Author: Sridhar Ratnakumar <sridharr@activestate.com>
Date:   Thu Oct 11 15:45:59 2012 -0700

    tail: use inotify instead of polling

    reduces cpu usage and fixes  Bug #95803
2012-10-11 21:29:35 -07:00
Sridhar Ratnakumar 6a5092ff5c Bug #95787: warn and ignore tailing app logs if their base dir (container) goes away fast
.. but not for system logs as we expect /s/logs/ to exist.
2012-10-10 15:13:13 -07:00
Sridhar Ratnakumar 99fe83b742 make tail.go its own package, independent of logyard 2012-10-09 15:13:05 -07:00