This log drainer transfers heroku logs to aws cloudwatch. The drainer runs on aws lambda. The installation of the lambda is performed via serverless.
-
Configure aws-cli
-
Install serverless
npm install -g serverless npm install
-
Install pyenv
curl https://pyenv.run | bash pyenv install 3.7.3 pyenv virtualenv 3.7.3 log-drainer-for-heroku-to-cloudwatch pyenv activate log-drainer-for-heroku-to-cloudwatch
-
Deploy
serverless deploy
-
Add drain to your heroku app
heroku drains:add https://your-end-point-name/prod/lambda_handler/your-log-group-name/your-log-stream-name -a your-app