serverless-apigateway-access-logs
Serverless plugin to configure Api Gateway access logs
Last updated 2 months ago by godu .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install serverless-apigateway-access-logs 
SYNC missed versions from official npm registry.

serverless-apigateway-access-logs

This Serverless-apigateway-access-logs plugin enables you to configure AWS API gateway access logs.

Installation

First, add `serverless-apigateway-access-logs to your project:

npm install serverless-apigateway-access-logs

Then inside your project's serverless.yml file, add following entry to the plugins section

plugins:
  - serverless-apigateway-access-logs

See example

Configuration

Plugin need to be configured with a log group, and a format. Log group just need a name, plugins takes care to ensure CloudWatchLogGroup creation.

To configure it, add something like the following to your serverless.yml.

custom:
  serverless-apigateway-access-logs:
    format: '{ "requestId":"$context.requestId", "ip": "$context.identity.sourceIp", "caller":"$context.identity.caller", "user":"$context.identity.user","requestTime":"$context.requestTime", "httpMethod":"$context.httpMethod","resourcePath":"$context.resourcePath", "status":"$context.status","protocol":"$context.protocol", "responseLength":"$context.responseLength" }'
    log-group: /aws/my-api/${self:provider.stage}/access-logs
    log-group-retention: 14 # optional, default to 7

You can also additionnaly add a stageTags mapping to have some tags attached to the API gateway stage.

Current Tags

  • 0.2.5                                ...           latest (2 months ago)
  • 0.2.5                                ...           next (2 months ago)

7 Versions

  • 0.2.5                                ...           2 months ago
  • 0.2.4                                ...           2 months ago
  • 0.2.3                                ...           5 months ago
  • 0.2.2                                ...           10 months ago
  • 0.2.1                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.1.0                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 7
Dependencies (2)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |