1.1.3 • Published 7 years ago

serverless-logstreaming v1.1.3

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

⚡️ Serverless Logstreaming Plugin

serverless npm license dependencies

About

This Serverless plugin allows for simple streaming of logs through a given function with the popular Serverless Framework and AWS Lambda.

Configuration

Currently this plugin ONLY works with the AWS provider.

  1. Add serverless-logstreaming to your serverless.yml file in the root of your serverless project
plugins:
  - serverless-logstreaming
  1. Define your loghandler function:
functions:
  myLogHandler:
    description: 'CW Logs handler for Tasks'
    handler: handlers/myLogHandler/handler.handler
  1. Reference the name of your loghandler function in the custom section:
custom:
  logHandler:
    function: myLogHandler

And that's all it takes. Now the logs of all your lambda functions will stream through that loghandler.

If you have a function where you don't want to stream logs through the loghandler it's as simple as adding an exception:

functions:
  handlerToNotStream:
    description: 'This lambda should not stream logs'
    loghandler: false

That loghandler: false will exempt this lambda from streaming through the loghandler function.

Changelog

  • 1.1.3 - Fix several permissions bugs. Remove unnecessary logFilter.
  • 1.1.0 - Add logstreaming permission by default instead of requiring user to do so, add flexibility in naming
  • 1.0.0 - Initial commit.

Acknowledgements

  • Thanks to @andymac4182 for the gist that inspired this plugin.
  • Thanks to @HyperBrain and the @serverless team