Possible issue preventing altering winston log-level?
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):
See nconf configuration (second):
I 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?
Depends... on why you need to change the log level
Could be that all you need is to run NodeBB in dev mode?
I think the problem is the
winston.verbose()already occurring within the
I'd move the
verboseconfig-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).
Ah, in that case, might I recommend setting the
NODE_ENVenvironment variable when running NodeBB?
NODE_ENV=development node app.js
Well that works! Thanks!