-
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
log time #2792
Comments
Can you provide a simple example to reproduce the problem ? |
Check my gist repo https://github.com/svipben/react-boilerplate |
As I say it happens randomly, so right now I get this:
As you can see not all messages get log time. |
I am experiencing the same behavior everywhere that I use PM2. I think it has something to do with the speed of log calls or perhaps async nature of the log calls. Whilst random, it seems highly reproducible. Exampleecosystem.config.jsmodule.exports = {
apps : [
{
"name": 'test',
"script": 'test.js',
"log_date_format": "YYYY-MM-DD HH:mm",
},
]
}; test.jsfor (var i = 0; i < 500; i++) {
console.log(i);
} Start it
Example output:
Code for above: issue 2792.tar.gz |
I am running into the same issue. This is how I start my node app: And here is an extract of my log:
It happens randomly but quite often. Some details:
update: I tried updating to the latest version ( |
Having a look at One hacky solution would be to split 'data' on '\n' and simply prefix each 'line' with the timestamp and output that instead. I did implement this and it does work. Hack Solution A:lib/God/ForkMode.js: ~ line 164
Example output:
There are many instances of this type of chunk handling in many places (stdout, stderr, formatted/unformatted) and the timestamps basically end up grouped/inaccurate, but something better isn't really possible within the process container stdout structure. Is there a better way? |
At first, thanks for PM2. Really loving the experience so far. Although unfortunately this issue is still open, but there is a PR for this? Why is that not merged yet - if I may ask? Would be really useful to have fixed in pm2. Currently experiencing the same issue, where consistently prefixes are missing. Thanks :) |
…nitech#2792 + cleanup travis file
Expected behaviour
Actual behaviour
Problem
As you can see I don't get time for
To stop development server use yarn pm2:stop
and this happens randomly...Software versions used
The text was updated successfully, but these errors were encountered: