Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@elastic/ecs-pino-format

Package Overview
Dependencies
Maintainers
57
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elastic/ecs-pino-format

A formatter for the pino logger compatible with Elastic Common Schema.

  • 1.5.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
336K
increased by5.24%
Maintainers
57
Weekly downloads
 
Created

What is @elastic/ecs-pino-format?

@elastic/ecs-pino-format is an npm package that provides a formatter for the Pino logger to produce logs that are compliant with the Elastic Common Schema (ECS). This allows for better integration with Elastic Stack tools like Elasticsearch, Kibana, and Logstash.

What are @elastic/ecs-pino-format's main functionalities?

Basic ECS Formatting

This feature allows you to create a Pino logger instance that formats log messages according to the Elastic Common Schema (ECS).

const pino = require('pino');
const ecsFormat = require('@elastic/ecs-pino-format');
const logger = pino(ecsFormat());

logger.info('This is an ECS formatted log message');

Custom ECS Fields

This feature allows you to add custom fields to the ECS formatted log messages, providing more flexibility in the log data.

const pino = require('pino');
const ecsFormat = require('@elastic/ecs-pino-format');
const logger = pino(ecsFormat({
  customField: 'customValue'
}));

logger.info('This log message includes custom ECS fields');

Integration with Elastic Stack

This feature demonstrates how to log events with specific ECS fields, making it easier to integrate and analyze logs within the Elastic Stack.

const pino = require('pino');
const ecsFormat = require('@elastic/ecs-pino-format');
const logger = pino(ecsFormat());

logger.info({
  event: {
    category: 'database',
    action: 'query'
  }
}, 'Database query executed');

Other packages similar to @elastic/ecs-pino-format

Keywords

FAQs

Package last updated on 31 Oct 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc