-
Notifications
You must be signed in to change notification settings - Fork 347
Open
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:
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');
})
Metadata
Metadata
Assignees
Labels
No labels