Unable to send bunyan logs in kibana using elastic apm node module (node js code)

Hi Team,

I have created a node js code where I created a bunyan logger class consist of a constructor that returns the logger in below format -

public logger: any
constructor (serviceName: string) {
this.logger = bunyan.createLogger(
name: serviceName,
serializers: bunyan.stdSerializers,
streams: [
{stream: process.stdout, level: 'info'},
{stream: process.stderr, level: 'error'}
],
return this.logger;
});

Later using this logger iam trying to log custom logs. I want to pass these bunyan logs generated in my application to Kibana dashboard. How ever when i use elastic_apm_node.start() options and in the logger value i give this parameter logger : this.logger, but these bunyan logs are not transfered to kibana. The traces are visible in service part of APM in kibana dasboard but what i wanted to acheive is these bunyan logs from application getting reflected in kibana

Please help me

Iam able to see the traces etc, but i would also like to see the bunyan logs reflecting in my kibana dasboard.

The default logger used in elastic_apm_node i can see is pino, but i dont think this should cause any issue in picking the bunyan logs into the streams in kibana

I see that by default the APM agent logs to stdout in ecs-logging format, in the ecs-logging only three formats are mentioned, however i want to integrate bunyan logs too. Is there any way to achieve this

@elastic_team requesting your help in my above issue. please suggest and help

@elastic_team anyone could suggest me how to integrate custom logs (bunyan) from application and sent to elastic APM

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.