Skip to content

Serverless Framework plugin that manages the API Gateway execution log groups created when execution logging is enabled

License

Notifications You must be signed in to change notification settings

coyoteecd/serverless-api-gateway-execution-log-manager

Repository files navigation

serverless-api-gateway-execution-log-manager

serverless license build status npm version

This Serverless Framework plugin manages the API Gateway execution log groups automatically created in CloudWatch when execution logging is enabled in serverless.yml. When enabling these logs, API Gateway automatically creates a CloudWatch log group named API-Gateway-Execution-Logs_[RestApiId]/[stage]. This log group is not part of the CloudFormation stack deployed by Serverless Framework.

The plugin does the following:

  • applies the log retention policy configured in serverless.yml (by default the API Gateway execution log group is configured with Expire=Never)
  • deletes the log group upon stack removal

Installation

npm install serverless-api-gateway-execution-log-manager --save-dev

Compatibility with Serverless Framework

Version 1.1.1 is compatible with Serverless Framework v3, but it uses the legacy logging interface. Version 2.0.0 and later uses the new logging interface.

serverless-api-gateway-execution-log-manager Serverless Framework
≤ v1.1.0 v1.x, v2.x
v1.1.1 v1.x, v2.x, v3.x
≥ v2.0.0 v3.x

Usage

Add the following to your serverless.yml:

plugins:
  - serverless-api-gateway-execution-log-manager

provider:
  logs:
    restApi:
      level: INFO
      executionLogging: true
      fullExecutionData: true

  logRetentionInDays: 7 # also applied to the execution logs with the plugin

This plugin does not have any configuration options (yet).

About

Serverless Framework plugin that manages the API Gateway execution log groups created when execution logging is enabled

Resources

License

Stars

Watchers

Forks

Packages

No packages published