Possible issue preventing altering winston log-level?
-
Hi guys,
I'm trying to set the winston.log-level manually on a running NodeBB instance via config.json and it appears the change doesn't take. Is this because the nconf setup should be called at the top of app.js, instead of further down below the winston configuration?See winston configuration (first):
https://github.com/NodeBB/NodeBB/blob/master/app.js#L36-L44See nconf configuration (second):
https://github.com/NodeBB/NodeBB/blob/master/app.js#L48-L56I switched the order of these two sections in my local install and at first glance it appears I'm now able to set the log-level via config.json.
Should I open a pull request on this?
-
I think the problem is the
winston.verbose()
already occurring within theloadConfig
function.I'd move the
verbose
config-loaded log behind that function call and put the winston configuration in between.
This way the logging preference may be set via the the config.json and no winston calls would happen before it is loaded.It would however prevent proper logging before the config.json file read. In my opinion this is bearable.
-
Thanks for the feedback. It's not critical and running in dev mode is what I do for most of the cases where I need verbose logging. However, it is good to be able let a server run for a few days to see what happens over a bit of time while users are actually using it (much more rare, but still valid).
-
Well that works! Thanks!