-
Notifications
You must be signed in to change notification settings - Fork 2k
replacing file-stream-rotator with winston #1334
replacing file-stream-rotator with winston #1334
Conversation
…inston which can be extended later for other use cases and integrations
Many tests fail here which seem unrelated to the change in this PR. |
…variable configurations
@meanjs/contributors things have been refactored and accommodated. Any comments? |
On initial review, this looks good. I'd like to pull it down and test sometime over the next couple of days. The refactor seems good too. I think I had originally built this out too tightly coupled with the file-stream-rotator library. Thus, the tests ended up being too specific, which more than likely created a bit more work for this refactor. Thanks @lirantal! I like this implementation much better. |
Thanks @mleanos After this one is merged my next PR on this topic will be to clean up all the |
@lirantal I've tested this, and it seems to be working as expected. Can we turn the console logs off during the tests? Having the "info" logs in the console makes it a bit harder to follow the tests, and is a bit distracting. Previously, the logger would only use the file system log when the tests were ran; I think this might be the desired behavior by most devs. |
…and disabling the app.log file transport option for the test environment
Hi @mleanos, |
@mleanos don't want to rush you but I do have a few other topics I'd like to fix which are infrastructure wise and I'd hate to deal with all the conflicts resolution later. |
@lirantal Thank you! I just pulled this down, and the "info" logs are still being logged to the console. I think we just need to comment out this line: https://github.com/lirantal/meanjs/blob/5b9b2fdee63c90f97864f8cbb9d131ab455abd8b/config/env/test.js#L18 Other than that, this all looks good to me. I commented out the above referenced line, and the console messages went away. Feel free to merge if you agree with my suggestion. Also, was your intention to log to the file system when the tests were ran? Just clarifying since you said two suggestions. |
Oh yeah, accidentally forgot to comment that out on the |
I'm gonna merge this one even though we got a low coverage score, at least we'll be removing the vulnerable and un-maintained |
Fixes #1285
Replacing file-stream-rotator with a better logging mechanism using winston which can be extended later for other use cases and integrations
file-stream-rotator
has been deprecated, no longer maintained and right now pose a security vulnerability for the MEAN.JS project.This PR
winston
as the logging mechanism which can be built upon for further and better log management in future refactoring and features.It is possible to preserve some of the settings but maybe we need to change naming conventions here as they were strictly related to the
morgan
HTTP requests logging and withwinston
we will be providing more than that.P.S.
Right now tests fail because there are checks for that specific
log
configuration option so I can either fix it with some adjustments and keep some of the options or remove the tests for this fix to be added now due to thefile-stream-rotator
vulnerability.