[PR #201] Use a JS only tail implementation #232

Open
opened 2026-03-03 16:06:08 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mthenw/frontail/pull/201
Author: @teid
Created: 3/21/2020
Status: 🔄 Open

Base: masterHead: useJsTail


📝 Commits (1)

  • 4ee667f Use a full JS tail implementation

📊 Changes

4 files changed (+196 additions, -56 deletions)

View changed files

📝 lib/tail.js (+106 -44)
📝 package-lock.json (+52 -9)
📝 package.json (+2 -1)
📝 test/tail.js (+36 -2)

📄 Description

In order to have the same behaviour between Linux and Windows (related to this issue: #197), I've switched to a lib that provide a JS only tail

This is still a work in progress, I still have to test it on Windows server, but I don't have it right now.

  • During a file rotation, we may loose couple of lines (until the retry). The native tail handle this in a better way though.
  • When we tail multiple files, tail has a syntax to display it:
test1.log sam. 21 mars 2020 17:54:08 CET
test1.log sam. 21 mars 2020 17:54:10 CET
test1.log sam. 21 mars 2020 17:54:11 CET
==> ../frontail/logs/test2.log <==
test2.log sam. 21 mars 2020 17:54:15 CET
test2.log sam. 21 mars 2020 17:55:04 CET
test2.log sam. 21 mars 2020 17:55:10 CET
test2.log sam. 21 mars 2020 17:55:12 CET
==> ../frontail/logs/test1.log <==
test1.log sam. 21 mars 2020 17:55:14 CET
test1.log sam. 21 mars 2020 17:55:17 CET
test1.log sam. 21 mars 2020 17:55:38 CET
test1.log sam. 21 mars 2020 17:55:47 CET

With this implementation, it's difficult to reproduce the same, so I changed the output (also, I allowed stdin to be followed along with other files):

../frontail/logs/test1.log - test1.log sam. 21 mars 2020 17:54:08 CET
../frontail/logs/test1.log - test1.log sam. 21 mars 2020 17:54:10 CET
../frontail/logs/test1.log - test1.log sam. 21 mars 2020 17:54:11 CET
../frontail/logs/test2.log - test2.log sam. 21 mars 2020 17:54:15 CET
                     stdin - stdin.log sam. 21 mars 2020 17:54:19 CET
                     stdin - stdin.log sam. 21 mars 2020 17:54:59 CET
                     stdin - stdin.log sam. 21 mars 2020 17:55:01 CET
                     stdin - stdin.log sam. 21 mars 2020 17:55:02 CET
../frontail/logs/test2.log - test2.log sam. 21 mars 2020 17:55:10 CET
../frontail/logs/test2.log - test2.log sam. 21 mars 2020 17:55:12 CET
../frontail/logs/test1.log - test1.log sam. 21 mars 2020 17:55:17 CET

Let me know what do you think about it :)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mthenw/frontail/pull/201 **Author:** [@teid](https://github.com/teid) **Created:** 3/21/2020 **Status:** 🔄 Open **Base:** `master` ← **Head:** `useJsTail` --- ### 📝 Commits (1) - [`4ee667f`](https://github.com/mthenw/frontail/commit/4ee667f99f41ff3b0cd377e80648d400b1cb381f) Use a full JS tail implementation ### 📊 Changes **4 files changed** (+196 additions, -56 deletions) <details> <summary>View changed files</summary> 📝 `lib/tail.js` (+106 -44) 📝 `package-lock.json` (+52 -9) 📝 `package.json` (+2 -1) 📝 `test/tail.js` (+36 -2) </details> ### 📄 Description In order to have the same behaviour between Linux and Windows (related to this issue: #197), I've switched to a lib that provide a JS only tail This is still a work in progress, I still have to test it on Windows server, but I don't have it right now. * During a file rotation, we may loose couple of lines (until the retry). The native tail handle this in a better way though. * When we tail multiple files, tail has a syntax to display it: ``` test1.log sam. 21 mars 2020 17:54:08 CET test1.log sam. 21 mars 2020 17:54:10 CET test1.log sam. 21 mars 2020 17:54:11 CET ==> ../frontail/logs/test2.log <== test2.log sam. 21 mars 2020 17:54:15 CET test2.log sam. 21 mars 2020 17:55:04 CET test2.log sam. 21 mars 2020 17:55:10 CET test2.log sam. 21 mars 2020 17:55:12 CET ==> ../frontail/logs/test1.log <== test1.log sam. 21 mars 2020 17:55:14 CET test1.log sam. 21 mars 2020 17:55:17 CET test1.log sam. 21 mars 2020 17:55:38 CET test1.log sam. 21 mars 2020 17:55:47 CET ``` With this implementation, it's difficult to reproduce the same, so I changed the output (also, I allowed stdin to be followed along with other files): ``` ../frontail/logs/test1.log - test1.log sam. 21 mars 2020 17:54:08 CET ../frontail/logs/test1.log - test1.log sam. 21 mars 2020 17:54:10 CET ../frontail/logs/test1.log - test1.log sam. 21 mars 2020 17:54:11 CET ../frontail/logs/test2.log - test2.log sam. 21 mars 2020 17:54:15 CET stdin - stdin.log sam. 21 mars 2020 17:54:19 CET stdin - stdin.log sam. 21 mars 2020 17:54:59 CET stdin - stdin.log sam. 21 mars 2020 17:55:01 CET stdin - stdin.log sam. 21 mars 2020 17:55:02 CET ../frontail/logs/test2.log - test2.log sam. 21 mars 2020 17:55:10 CET ../frontail/logs/test2.log - test2.log sam. 21 mars 2020 17:55:12 CET ../frontail/logs/test1.log - test1.log sam. 21 mars 2020 17:55:17 CET ``` Let me know what do you think about it :) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/frontail#232
No description provided.