Socket
Socket
Sign inDemoInstall

@ssense/node-logger

Package Overview
Dependencies
90
Maintainers
9
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ssense/node-logger

Application and access logger


Version published
Maintainers
9
Created

Readme

Source

Node Logger

Build Status

SSENSE Standardized Logs

Application Logger

// Inclusion
import {Logger} from '@ssense/node-logger';
// Usage
const logger = new AppLogger(LogLevel.Silly);
logger.setAppId('your_app_id');
// Enable / Disable
logger.enable(true);
// Set log level
logger.setLevel('Silly');
// Prettify / Indent
logger.makePretty(true);

// Log
// silly(message: string, id?: string, tags?: string[], details?: any)
// verbose(message: string, id?: string, tags?: string[], details?: any)
// info(message: string, id?: string, tags?: string[], details?: any)
// warn(message: string, id?: string, tags?: string[], details?: any)
// error(message: string, id?: string, tags?: string[], details?: any)
logger.silly('Some log message');
logger.error(`Error with paypal express checkout: ${orderId}`, logger.getRequestId(), ['checkout', 'paypal'], error.stack);

Access logger

import {AccessLogger} from '@ssense/node-logger';
const accessLogger = new AccessLogger(process.env.NODE_ENV === 'development');
// Enable / Disable
accessLogger.enable(true);
// Prettify / Indent
accessLogger.makePretty(true);

// Log
// logRequest(req: Request, res: Response)
accessLogger.logRequest(req, res);

Keywords

FAQs

Last updated on 14 Dec 2016

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