Open xiulunlin opened 9 years ago
Same without the --raw
option?
@soyuka Yes. The app name is colored but raw data not.
@Tjatse thoughts on this? I try to find from where this issue could come, but we're directly streaming stdout output to the file.
Yes, this issue exists even when using the --raw option. Strings in pretty printed objects are green, otherwise everything else including log level (info, warn, error) or custom colors using chalk.green, chalk.blue etc are not displayed.
So, you wanna enable colors?
Just try to use the following declaration / cmd to (re)start your PM2
script:
{
"apps": [
{
"[SOME]":"[CONFIGS]",
"args": [
"--color"
]
}
]
}
or
$ pm2 start myapp.js -- --color
works like a charm! thanks! :+1:
Is this still valid @chaudhryjunaid ? Because I can see colors at all, no matter the --raw or --color combo (using config.js file).
@damianobarbati I have not used winston with pm2 in a long time now...
Without pm2
pm2 logs --raw