Socket
Book a DemoInstallSign in
Socket

@lamware/powertools-logger

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lamware/powertools-logger

Lamware Middleware to utilize the official Logger powertools

latest
Source
npmnpm
Version
2.0.1
Version published
Maintainers
1
Created
Source
NPM Discord Apache-2.0

Lamware - AWS Powertools Logger

This Lamware Middleware utilizes the official Lambda TypeScript Powertools provided by AWS to:

  • Set-up and memoize a root Logger instance
  • Automatically add Lambda Context to all logging (can be disabled)
  • Provide a logging interface to all further middleware & the handler itself

Installation

This package is available via NPM:

yarn add @lamware/powertools-logger

# or

npm install @lamware/powertools-logger

Usage

import { powertoolsLogger } from '@lamware/powertools-logger';
import type { APIGatewayProxyHandlerV2 } from 'aws-lambda';
import { lamware } from '@lamware/core';

const { handler } = lamware<APIGatewayProxyHandlerV2<any>>()
  .use(powertoolsLogger({
    // Options are pass-through to the Logger instance.
    serviceName: 'my-api',
  }))
  .execute(async ({ state, logger }) => {
    logger.debug('Hello world!');

    return { statusCode: 200 };
  });

export { handler };

Keywords

lambda

FAQs

Package last updated on 21 Mar 2023

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