Moleculer v0.14.2 Release Notes
Release Date: 2020-02-14 // about 4 years ago-
👌 Support custom loggers
If you have your custom logger you should wrap it into a
Logger
class and implement thegetLogHandler
method.Using a custom logger
// moleculer.config.js const BaseLogger = require("moleculer").Loggers.Base; class MyLogger extends BaseLogger { getLogHandler(bindings) { return (type, args) => console[type](`[MYLOG-${bindings.mod}]`, ...args); } } module.exports = { logger: new MyLogger() };