I have an application running on Heroku using the papertrail add-on. Everything works perfectly and logs from that app are shown in there. My problem comes when I want to log to the same papertrail account from jobs running in other servers like AWS. In particular, I'm trying to setup a docker container for jobs that are only run in certain occasions (and for some technical limitations they cannot be run in heroku).
I have checking how to setup the unix loggers to automatically send logs to papertrail. My problem is that I do not have a papertrail dns or a port. Heroku only gives a papertrail token.
Any idea how to send logs to papertrail using my add-on credentials from a different unix server?
You can use logspout which can route all container logs (from the host) to a different location, for example to papertrail.
You can find a
docker run
example of the website, here below is adocker-compose
example which is quite convenient when you run multiple containers and want to gather all logs together.The destination
logs2.papertrailapp.com:55555
is provided by Papertrail in Settings->Log Destinations