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.
Requires Docker.
$ make tests
Use the serverless toolbox,
# From the `serverless-toolbox` directory,
# Replace ~/dev/lambda-papertrail with the path to the
# `lambda-papertrail` directory on your host machine.
$ SRC=~/dev/lambda-papertrail make toolbox
$ sls deploy -f forwarder --stage prod
$ sls logs -f forwarder --stage prod
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-prod.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).
© 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.