-
Notifications
You must be signed in to change notification settings - Fork 2k
[hotfix] Logger Development config default #1019
Conversation
Reverts the default Logger setting to use the stdout by default, rather than the stream option.
LGTM |
@mleanos why would users not want to stream into a file? |
@ilanbiala I use PM2 across my servers for node applications, and PM2 automatically takes the stdout and saves it to a rotating file that I can easily tail multiple processes at the same time with, so I personally like stdout being the primary. |
@ilanbiala I think it makes more sense to use stdout for Development, since it was the default being used before the Logger was implemented. I was afraid it would throw some users off. For Production, it makes sense to use the Stream option by default. |
@mleanos who wouldn't use PM2 or forever in production though? My point is why not just let them handle it (rotating file logging) completely? |
@ilanbiala This doesn't really affect the use of PM2 or forever. Although, PM2 has a way to rotate logs, our current implementation is using Morgan for logging. This change only affects the Morgan express middleware that we're using to log. The Development env config will use stdout by default, but the setting can be changed to use the Stream option. As for Production, it seemed appropriate to set Morgan to save the logs to a file by default. Is that what you're questioning? I don't see how PM2, or forever come into play here. I can see a loose relation to the former, but for our current implementation it's not really relevant. |
@codydaig said that PM2 can use output from stdout and rotate it through logs, so we can just always have Morgan log through stdout, no? |
@ilanbiala We're not implementing PM2 in this project. So the Morgan Stream option provides a way to log to a file. This allows out-of-the-box filesystem logging capabilities for our users. |
@ilanbiala That seems like a great suggestion. Let's get something into the 0.5.0 pipeline for PM2 integration. However, I think we can merge this simple change in, to support our current implementation of Morgan. |
Change logger development config to use stdout rather than stream
@ilanbiala No I haven't used it. But I've been looking at it, and like what I see. Thanks for merging! |
Reverts the default Logger setting to use the stdout by default, rather than the stream option for the Development env config.
I realized this might trip some users up, since when the Logger config was implemented (8cd2291) I had overlooked the fact that users probably wouldn't want the Stream option turned on by default.