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

@zhike/logger

Package Overview
Dependencies
Maintainers
4
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zhike/logger

A logger has following features:

  • 0.0.1
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
4
Weekly downloads
 
Created
Source

A logger has following features:

*. support log to console, file, elasticsearch, kafka, sentry
*. log to file support rotating by time
*. customized formatter
*. supported levels: fatal, error, warning, info, debug

Demo

const logger = new Logger({
  console: {},
  elasticsearch: {
    endpoint: '172.16.3.2:19200',           // es server endpoint
    defaultIndex: 'demo',                   // default target index
    level: 'warning',                       // log level under warning is supressed
  },
  file: {
    rotateFilename: '[logs/demo_]YYYY-MM-DD[.log]',     // rotate by day
    level: 'info',                          // log level under info is supressed
  },
})

logger.debug('debug 1')
logger.info('info 1')
logger.info('info 2')
// log to es with index 'demo1' but not default 'demo'
logger.error('error 1', { index__: 'demo1' })

FAQs

Package last updated on 07 May 2018

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