mirror of
https://github.com/NarrativeScience-old/log.io.git
synced 2026-04-26 17:45:57 +03:00
[GH-ISSUE #113] [Feature Request] Add Rigorous file checking ability to harverster #88
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/log.io-NarrativeScience-old#88
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JavaScriptDude on GitHub (Feb 17, 2014).
Original GitHub issue: https://github.com/NarrativeScience-old/log.io/issues/113
Its well know that fs.watch does not work in all cases. I can confirm one solid test case illustrating this issue:
On windows use
When watching ping.log in log.io, fs.watch will not detect changes unless certain external events occur such as the user refreshing windows explorer looking at the folder.
This feature request is to add a new option for harvester to allow for rigorous file checks where the user can define a threshold for checking and the harvester runs a parallel fs.stat check against the file being watched.
I have implemented this in a fork of bunyan CLI which uses some code borrowed from harvester.js. You can see the the preliminary code here: https://github.com/JavaScriptDude/node-bunyan/trunk/bin/bunyan. See the -r option.
FYI - My bunyan fork is to implement tail -n and tail -f functionality into bunyan CLI and hopefully get it integrated back into the main bunyan tree.
@Ugenx commented on GitHub (Jul 21, 2015):
Hey did you ever get anywhere with this? Currently running into the same issue with log files in our .NET projects not getting updated until someone opens them in explorer or another external event forces the modified date to get updated.
@JavaScriptDude commented on GitHub (Jul 22, 2015):
No. I wrote a fork and got it working actually but it did not get pulled back. You can take a look at my fork and maybe it can be merged to the current head without any conflicts.
The reason I stopped pushing was that I since switched away from Windows as my development platform.
Personally, I see this as a large gap in the bunyan library as the best way to debug any app is with a tail window spitting out logs in real time =) Poor Windows developers don't have this opportunity with Bunyan and this makes it kind of weak on the Windows platform IMO.
@Ugenx commented on GitHub (Jul 22, 2015):
From my reading it's more a limitation of NTFS than anything else; files with an open handle don't have their modified timestamp updated unless it is opened by another process which then forces the update. You can read more about it here, though the English is a little rough around the edges: http://goo.gl/mC2Erx
@msmathers commented on GitHub (May 22, 2020):
Since v0.4.14, log.io uses the chokidar file watching library, which provides robust file watching customization. Users can specify which file watching mechanism should be used for specific file paths, including polling.
Closing for now, feel free to open a new issue if chokidar doesn't provide the functionality you're seeking.
@JavaScriptDude commented on GitHub (May 22, 2020):
No issues. Thanks for reviewing and closing.