elastic / elastic/docs

Missing a parenthesis at ECS node.js logging

Open
#3,027 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
265
Forks
347
Avg merge
3d 15h
Merged PRs (30d)
2

Description

At the link https://www.elastic.co/guide/en/ecs-logging/nodejs/current/pino.html#pino-ref, there is a missing "(" in the code:

![image](https://github.com/elastic/docs/assets/8455957/abdbcf93-b9eb-4c3f-a86b-9ba07c41273e)

The correct code should be:

```
const http = require('http');
const { ecsFormat } = require('@elastic/ecs-pino-format');
const pino = require('pino');

const log = pino(ecsFormat({ convertReqRes: true }));

const server = http.createServer(function handler (req, res) {
res.setHeader('Foo', 'Bar');
res.end('ok');
log.info({ req, res }, 'handled request');
});

server.listen(3000, () => {
log.info('listening at http://localhost:3000');
})
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.