Node.js: Winston: Can I add default meta data to all log messages

For Winston v2 (see comments) There are now rewriters. For example, the below will add a property app to every metadata going through this logger. logger.rewriters.push(function(level, msg, meta) { meta.app = ‘myApp’; return meta; }); You can also declare it when building the logger: new (winston.Logger)({ level: config.log[file].level, rewriters: [ (level, msg, meta) => { … Read more

Winston: how to rotate logs

winston author and maintainer here. Logging to a new file everyday is currently an open feature request: https://github.com/flatiron/winston/issues/10. Would love to see someone implement it. That said, there are other options: The File transport accepts a maxsize option which will rotate the logfile when it exceeds a certain size in bytes. There is also an … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)