Skip to content

xoeye/serverless-log-keeper

Repository files navigation

@xoi/serverless-log-keeper

Log Keeper

Serverless Framework plugin that adds a deletion retain policy on aws lambda logs

npm Version badge Unit Tests codecov

Usage

  1. To use this serverless plugin, you must first install it as a dependency.

    Run npm install --save-dev @xoi/serverless-log-keeper or yarn add --dev @xoi/serverless-log-keeper

  2. Add the plugin to your serverless.yml and add its configuration properties

    [...]
    region: us-east-2
    
    plugins:
      - '@xoi/serverless-log-keeper'
    
    logkeeper:
      keepLambdaLogs: true
    [...]
  3. Continue using Serverless as you normally would! Logkeeper will automatically add a deletion policy of retain to each /aws/lambda LogGroup

Configuration

All configuration is done in serverless.yml at the root level under the logkeeper property.

Here are the possible configuration options:

Configuration Key Required? Default Description
keepLambdaLogs Yes N/A A boolean that determines if we're going to retain lambda logs or not

Contributing

We welcome all contributors with open arms! See CONTRIBUTING.md