-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logs added to the file is not displayed on Windows #197
Comments
I modified frontail to use node-tail instead of fs-tail-stream I changed the file /* eslint no-underscore-dangle: off */
'use strict';
const events = require('events');
const childProcess = require('child_process');
const TailLib = require('tail').Tail;
const util = require('util');
const CBuffer = require('CBuffer');
const byline = require('byline');
const commandExistsSync = require('command-exists').sync;
function Tail(path, opts) {
events.EventEmitter.call(this);
const options = opts || {
buffer: 0
};
this._buffer = new CBuffer(options.buffer);
let tail = new TailLib(path.join(), {
encoding: 'utf-8',
follow: true,
useWatchFile: true,
flushAtEOF: true
});
tail.on("line", (line) => {
const str = line.toString();
this._buffer.push(str);
this.emit('line', str);
});
}
util.inherits(Tail, events.EventEmitter);
Tail.prototype.getBuffer = function getBuffer() {
return this._buffer.toArray();
};
module.exports = (path, options) => new Tail(path, options); It's the option |
Hey, Can you create a PR for that? |
Sure I can do that. When
|
I think it makes sense to enable that only on windows |
Hi :)
First I wanted to thank you for this project. I've used it on Linux and it's a great tool !
Recently, I tried to use it on Windows Server 2016 with a Java application and log4j.
When the application adds some lines in the log file, I don't see the update in frontail.
Even if I reload the browser.
But, when I open the log file on the server with another program like Notepad++, the logs are instantly loaded in frontail.
This looks like the behavior described here:
https://docs.microsoft.com/en-us/archive/blogs/asiasupp/file-date-modified-property-are-not-updating-while-modifying-a-file-without-closing-it
They suggest to open and close a handle on the log file.
Would you accept to do this in frontail ?
Regards,
Timothée
The text was updated successfully, but these errors were encountered: