serverless-logstreaming
v1.1.3
Published
Serverless Logstreaming Plugin - Stream logs to the loghandler function
Downloads
10
Maintainers
Readme
⚡️ Serverless Logstreaming Plugin
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.
- Add
serverless-logstreaming
to yourserverless.yml
file in the root of your serverless project
plugins:
- serverless-logstreaming
- Define your loghandler function:
functions:
myLogHandler:
description: 'CW Logs handler for Tasks'
handler: handlers/myLogHandler/handler.handler
- 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