Closed hbinduni closed 1 year ago
It's written in the README: https://github.com/platformatic/platformatic/issues/348.
for reference, i can do multiple transport using code like this:
import pino from 'pino';
const db = {
level: 'info',
target: './mongo-transport.js',
options: {
collection: 'logs',
database: 'db1',
},
};
const pretty = {
level: 'info',
target: 'pino-pretty',
options: {
colorize: true,
translateTime: 'SYS:isoDateTime',
ignore: 'pid,hostname',
},
};
const transports = pino.transport({
targets: [db, pretty],
});
export const logger = pino(transports);
Hi, i try to implement like this:
but having this error:
how to fixed this issue? also how to apply
pino-pretty
alongside withpino-mongodb
? i want to show in console usingpino-pretty
but want to save the log inmongodb
too.thank you