Coder Social home page Coder Social logo

lambda-papertrail's Introduction

lambda-papertrail

This is lambda-papertrail, a Lambda function to forward logs from CloudWatch to Papertrail. It is built with the Serverless Framework, and is a perfect companion to the serverless-log-forwarding plugin.

Getting Started

Install Node 12.x, Docker, and the AWS CLI. Then clone this repository & install dependencies:

# Install dependencies
npm install

# Run local tests:
npm test

Next, configure serverless-dev (for dev & QA stages) and serverless-production IAM roles:

$ aws configure --profile serverless-dev
AWS Access Key ID [None]: **************
AWS Secret Access Key [None]: **************
Default region name [None]: us-east-1
Default output format [None]: text

$ aws configure --profile serverless-production
AWS Access Key ID [None]: **************
AWS Secret Access Key [None]: **************
Default region name [None]: us-east-1
Default output format [None]: text

Finally, run either npm run deploy:dev, npm run deploy:qa, or npm run deploy:prod to deploy!

Usage

You can now easily forward logs from any other Serverless application with serverless-log-forwarding.

plugins:
  - serverless-log-forwarding

custom:
  logForwarding:
    destinationARN: ${cf:lambda-papertrail-${opt:stage}.ForwarderLambdaArn}

You can also manually attach a log group by clicking Actions โ†’ Stream to AWS Lambda from the CloudWatch Log Groups dashboard. Then just choose the appropriate destination Lambda function (e.g. lambda-papertrail-prod-forwarder) and configure a filter (or "Other" to forward all log messages).

License

ยฉ DoSomething.org. lambda-papertrail is free software, and may be redistributed under the terms specified in the LICENSE file. The name and logo for DoSomething.org are trademarks of Do Something, Inc and may not be used without permission.

lambda-papertrail's People

Contributors

dependabot[bot] avatar dfurnes avatar jtjeferreira avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.