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

@sinet/logger

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sinet/logger

Default logger setup using Winston

  • 2.2.3
  • latest
  • Source
  • npm
  • Socket score

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

Logger

Build Status Dependency Status devDependency Status

Winston logger to use with the Logstash and Kibana.

Usage

npm install @sinet/logger --save

Example

// Options are for winston transports, file and console
var options = {
	'file' : {
		// File transport is enabled on development and production environment
		'enabled'  : [ 'development', 'production' ],
		'filename' : 'logs/myLogFile.log',
	},

	'console' : {
		// Console transport is enabled only in development environment
		'enabled' : [ 'development' ],
		'level'   : 'debug'
	},

	'logstash' : {
		'enabled' : [ 'production' ],
		'port'    : 9563
	},

	// These are additional fields that get added to all logs
	'additional' : {
		'container' : 'user-service',

		// The items below are defaults added by the library automatically
		'hostname'   : os.hostname(),
		'dockerhost' : process.env.DOCKER_HOST || 'undefined'
	}
};

var logger = require( '@sinet/logger' )( options );

logger.error( 'error message', { 'method': 'v1.users.get', 'payload', payload } );

FAQs

  1. What happens when I add a file or console option without setting the enabled property?
// Example
var options = {
	'file'    : {},
	'console' : {}
}

Answer: If file and/or console is explicitly provided without setting the enabled property it will log in any environment.

Contributing

All pull requests must follow coding conventions and standards.

FAQs

Package last updated on 27 Nov 2017

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