Socket
Socket
Sign inDemoInstall

pino

Package Overview
Dependencies
Maintainers
4
Versions
310
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pino

super fast, all natural json logger


Version published
Weekly downloads
7.8M
decreased by-1.42%
Maintainers
4
Weekly downloads
 
Created

What is pino?

Pino is a very low overhead Node.js logger, which is inspired by Bunyan. It is designed to be as minimal as possible and to perform logging tasks with a very small performance overhead. Pino provides a simple to use API for structured logging and can be easily integrated with different transports for log processing.

What are pino's main functionalities?

Basic Logging

This feature allows you to perform basic logging tasks, such as logging informational messages.

const pino = require('pino');
const logger = pino();
logger.info('Hello, this is an info message!');

Logging with Different Levels

Pino allows you to log messages with different severity levels, such as error, warn, and debug.

const logger = pino();
logger.error('This is an error message');
logger.warn('This is a warning message');
logger.debug('This is a debug message');

Child Loggers

You can create child loggers from a parent logger, which can inherit the configuration of the parent and can also have additional properties.

const parentLogger = pino();
const childLogger = parentLogger.child({ a: 'property' });
childLogger.info('Hello from child logger');

Custom Serializers

Pino allows you to define custom serializers for logging objects in a specific way.

const logger = pino({
  serializers: {
    req: (req) => ({ method: req.method, url: req.url })
  }
});
logger.info({ req: requestObject }, 'Request log message');

Pretty Printing

For development purposes, Pino can be combined with the 'pino-pretty' module to format logs in a more readable way.

const pino = require('pino');
const pretty = require('pino-pretty');
const logger = pino(pretty());
logger.info('This will be pretty printed');

Other packages similar to pino

Keywords

FAQs

Package last updated on 26 Dec 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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc