Socket
Socket
Sign inDemoInstall

@adikari/logger

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adikari/logger

Logger library


Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Serverless Logger

Library to use as logger in your serverless application. This wraps around pino logging library and provides some sane defaults for logging in AWS.

Installation

# Via yarn
$ yarn add @adikari/logger

# Via npm
$ npm install @adikari/logger

How to use

Check pino api reference for list of all available methods.

Setting log level

By default the level is set to info. You can override by setting environment variable called LOG_LEVEL. If STAGE is set to dev, then the level will be set to debug if LOG_LEVEL environment variable is not present.

const { logger } = require('@adikari/logger');

const handler = event => {
  logger.debug(event, 'serverless event');
  logger.info({ userid: 'anton' }, 'user');
};

module.exports = { handler };

This library adds extra metadata

Keywords

FAQs

Package last updated on 11 Feb 2021

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