moleculer icon indicating copy to clipboard operation
moleculer copied to clipboard

BrokerOptions typescript definition does not contain logFormatter property

Open koldoon opened this issue 1 year ago • 1 comments

In typescript project I can't setup logFormatter. According to documentation:

const broker = new ServiceBroker({ 
    logFormatter(level, args, bindings) {
        return level.toUpperCase() + " " + bindings.nodeID + ": " + args.join(" ");
    }
});

Typescript says:

TS2345: Argument of type
{   logFormatter(level: any, args: any, bindings: any): string; }
is not assignable to parameter of type  BrokerOptions 
Object literal may only specify known properties, and  logFormatter  does not exist in type  BrokerOptions

koldoon avatar Oct 05 '23 18:10 koldoon

the logFormatter is not a broker options, it's a Logger options as formatter. Maybe you see older version of Moleculer.

icebob avatar Oct 08 '23 10:10 icebob