
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@elastic/ecs-pino-format
Advanced tools
A formatter for the pino logger compatible with Elastic Common Schema.
This Node.js package provides a formatter for the pino logger compatible with Elastic Common Schema (ECS) logging. In combination with the filebeat shipper, you can send your logs directly to Elasticsearch and leverage Kibana's Logs app to inspect all logs in one single place.
pino 6.x, 7.x, and 8.x versions are supported.
Please see the Node.js ECS pino documentation.
npm install @elastic/ecs-pino-format
This package will configure Pino's formatters, messageKey and timestamp options.
const { ecsFormat } = require('@elastic/ecs-pino-format')
const pino = require('pino')
const log = pino(ecsFormat(/* options */))
log.info('Hello world')
const child = log.child({ module: 'foo' })
child.warn('From child')
Running this will produce log output similar to the following:
{"log.level":"info","@timestamp":"2023-10-16T18:08:02.601Z","process.pid":74325,"host.hostname":"pink.local","ecs.version":"8.10.0","message":"Hello world"}
{"log.level":"warn","@timestamp":"2023-10-16T18:08:02.602Z","process.pid":74325,"host.hostname":"pink.local","ecs.version":"8.10.0","module":"foo","message":"From child"}
Please see the Node.js ECS pino documentation for more.
This software is licensed under the Apache 2 license.
pino-elasticsearch is a transport for Pino that sends logs directly to Elasticsearch. While it doesn't format logs according to ECS, it provides a seamless way to send logs to Elasticsearch for storage and analysis.
winston-elasticsearch is a transport for the Winston logger that sends logs to Elasticsearch. Similar to pino-elasticsearch, it doesn't format logs according to ECS but offers integration with Elasticsearch for log storage and analysis.
Bunyan is another JSON logging library for Node.js that can be configured to send logs to Elasticsearch. While it doesn't natively support ECS formatting, it offers a flexible logging solution with Elasticsearch integration.
FAQs
A formatter for the pino logger compatible with Elastic Common Schema.
The npm package @elastic/ecs-pino-format receives a total of 411,326 weekly downloads. As such, @elastic/ecs-pino-format popularity was classified as popular.
We found that @elastic/ecs-pino-format demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 57 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.