It not working with nestjs
Closed this issue · 2 comments
dk-khoado commented
LoggerModule.forRootAsync({
providers: [ConfigService],
useFactory: (config: ConfigService) => {
const streamToElastic = pinoElastic({
index: 'search-audi-log',
node: config.get('ES_URL', 'https://localhost:9200'),
flushBytes: 1000,
auth: {
apiKey:
'ZmZGV0hJd0JISnhuOVB5aTlqUW06djBGM21kWjZRUS1xemZhZGI3QTF4dw==',
},
// tls: { rejectUnauthorized: false },
opType: 'create',
});
return {
pinoHttp: [
{ level: 'info', transport: { target: 'pino-pretty' } },
streamToElastic,
],
};
},
inject: [ConfigService],
}),
neverovski commented
I'm using pino-elastic in my nestjs application.
You should remove param - { transport: { target: 'pino-pretty' } }, or use pinoMultiStream for multi stream