Closed vdepatla closed 5 years ago
The type definitions don't allow a winston transport to be used as an appender. A (dirty) workaround is to set the appender in pure JS code. But this also works just up to winston:2.4.4.
Apparently winston support is utterly broken in jsnlog.
A fix for this has now been released as part of version 2.29.0.
Getting below error when I try to assign winston console transport as an appender. Any Idea ? Type 'ConsoleTransportInstance' is not assignable to type 'JSNLogAppender'. Property 'setOptions' is missing in type 'ConsoleTransportInstance'.
Code : const consoleAppender = new winston.transports.Console({ json: false, formatter: options => { const logEntry: ClientSideLoggingResult = { host: os.hostname(), pid: process.pid, level: options.level.toString(), ts: moment().format(), eventData: options.meta, component: globalStrings.componentName }; return JSON.stringify(logEntry); } });