-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
command shows extra one-character line
#338
Comments
I'm seeing this as well. It seems that the info is correctly written to the logfile itself and when Looking at the code, I suspect that the problem is here: https://github.com/Unitech/pm2/blob/master/lib/Log.js#L46 The "start" and "end" parameters are both inclusive. This means that if you pass the size of a file to "end", it will try to read one past the end. Normally, reading just stops at EOF, but when writing happens after the stat, but before EOF is reached, this reads one extra byte of data. Changing the With both changes applied, I haven't seen the problem occur again so far. I'm not sure if this is a complete solution though - my gut feeling says there is still a race condition hidding somewhere (at the very least it is possible for a single log line to be spread over two lines of output). |
Nice! Would you be able to make a Pull-Request on that? |
I have an app that outputs lots of messages in verbose mode, about 3-5 lines per second.
pm2 logs
shows the log scrolling, but sometimes one line is show before the real log line, containing only the first character of the real log line:The text was updated successfully, but these errors were encountered: