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

**URL:** <https://discuss.elastic.co/t/unable-to-send-bunyan-logs-in-kibana-using-elastic-apm-node-module-node-js-code/329652>\
**Category:** Elastic Agent\
**Created:** [April 10, 2023, 10:46am UTC](https://discuss.elastic.co/t/unable-to-send-bunyan-logs-in-kibana-using-elastic-apm-node-module-node-js-code/329652 "2023-04-10T10:46:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandboxpd123](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@sandboxpd123](https://discuss.elastic.co/u/sandboxpd123)\
**Post date:** [April 10, 2023, 10:46am UTC](https://discuss.elastic.co/t/unable-to-send-bunyan-logs-in-kibana-using-elastic-apm-node-module-node-js-code/329652/1 "2023-04-10T10:46:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sandboxpd123](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@sandboxpd123](https://discuss.elastic.co/u/sandboxpd123)\
**Post date:** [April 10, 2023, 10:53am UTC](https://discuss.elastic.co/t/unable-to-send-bunyan-logs-in-kibana-using-elastic-apm-node-module-node-js-code/329652/2 "2023-04-10T10:53:10Z")

</div>

I see that by default the APM agent logs to stdout in [ecs-logging](https://www.elastic.co/guide/en/ecs-logging/overview/master/intro.html) 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

---

<div class="post-metadata">

**Author:** ![sandboxpd123](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@sandboxpd123](https://discuss.elastic.co/u/sandboxpd123)\
**Post date:** [April 11, 2023, 2:14pm UTC](https://discuss.elastic.co/t/unable-to-send-bunyan-logs-in-kibana-using-elastic-apm-node-module-node-js-code/329652/3 "2023-04-11T14:14:59Z")

</div>

[@elastic\_team](https://discuss.elastic.co/groups/elastic_team) requesting your help in my above issue. please suggest and help

---

<div class="post-metadata">

**Author:** ![sandboxpd123](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@sandboxpd123](https://discuss.elastic.co/u/sandboxpd123)\
**Post date:** [April 13, 2023, 4:52am UTC](https://discuss.elastic.co/t/unable-to-send-bunyan-logs-in-kibana-using-elastic-apm-node-module-node-js-code/329652/4 "2023-04-13T04:52:32Z")

</div>

[@elastic\_team](https://discuss.elastic.co/groups/elastic_team) anyone could suggest me how to integrate custom logs (bunyan) from application and sent to elastic APM

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 11, 2023, 4:53am UTC](https://discuss.elastic.co/t/unable-to-send-bunyan-logs-in-kibana-using-elastic-apm-node-module-node-js-code/329652/5 "2023-05-11T04:53:16Z")

</div>

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