1.1.8 • Published 3 years ago

aws-lambda-log-wrapper v1.1.8

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

aws-lambda-log-wrapper

npm version

A tiny little wrapper around the amazing Lambda Log library for use as logging middleware in AWS SDK for JavaScript v3.

Installation

yarn add aws-lambda-log-wrapper

OR

npm i aws-lambda-log-wrapper

Usage

import { AwsLambdaLogWrapper } from 'aws-lambda-log-wrapper';
import { STSClient, GetCallerIdentityCommand } from '@aws-sdk/client-sts';
import { LambdaLog } from 'lambda-log';

const log = new LambdaLog();

new STSClient({ logger: new AwsLambdaLogWrapper(log) }).send(new GetCallerIdentityCommand({}))

Writes the following to the console:

{
  "_logLevel": "info",
  "msg": "AWS: Call STSClient.GetCallerIdentityCommand",
  "clientName":"STSClient",
  "commandName":"GetCallerIdentityCommand",
  "input": {},
  "output": {
    "UserId": "...",
    "Account": "...",
    "Arn": "arn:aws:sts::...:assumed-role/..."
  },
  "metadata": {
    "httpStatusCode": 200,
    "requestId": "25fe0f95-7975-443f-bcd9-65321461aa43",
    "attempts": 1,
    "totalRetryDelay": 0
  },
  "aws-sdk": true,
  "_tags": []
}
1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago