Socket
Socket
Sign inDemoInstall

@abtnode/logger

Package Overview
Dependencies
156
Maintainers
3
Versions
612
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @abtnode/logger

ABT Node logger lib


Version published
Maintainers
3
Install size
24.1 MB
Created

Readme

Source

logger

This is a log library for ABT Node.

Enable logging first

Set the environments: process.env.ABT_NODE_LOG_DIR = {logging directory}.

Write to files

Set the environments: process.env.NODE_ENV = 'production'.

Writing to console

DEBUG=@abtnode/* npm run xxx.

Or, the logs will be write to stdout.

Rotate log files

Rotate log files every day, log filename formate {label}-YYYY-MM-DD.log.

[!Important] Default retained log files

Because it is for internal use, the default log is kept for 60 days.

Usage

const logger = require('@abtnode/logger')('@abtnode/cli');

// log info
logger.info('detail blocklet', { did: 'z8iZpWP3gto8RWk9UHfvAaYtqX5wZ3Mz9BrHA' });
// [2020-08-12 17:26:28] [info]  "detail blocklet" {"did":"z8iZpWP3gto8RWk9UHfvAaYtqX5wZ3Mz9BrHA"}

// log error: must pass an object
logger.info('this is an error', { error: new Error('test') });

Keywords

FAQs

Last updated on 27 Apr 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc