2.0.1 • Published 3 years ago

@lamware/powertools-logger v2.0.1

Weekly downloads
-
License
GPL-3.0-only
Repository
github
Last release
3 years ago

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 };
1.2.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.30

3 years ago

1.0.29

3 years ago

1.0.28

4 years ago

1.0.27

4 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago