Papertrail has no direct support for Clojure/Timbre, but it's easy enough to set it up using traditional Java logging tools.
This Gist demonstrates one way to set up your logging in a Clojure application to send Timbre logs to Papertrail.
The general idea is:
Timbre --(via Timbre appender)--> tools.logging --(via factory)--> Log4j --(via Log4j Syslog appender)--> Papertrail
To use this, don't forget to replace <PAPERTRAIL_HOST> and <PAPERTRAIL_PORT> with the appropriate values in your log4j.properties
.
It's easy to use something else than log4j (e.g logback) as long as it is support by both Papertrail and tools.logging.
To be more realistic, this code assumes there's a LOG_TO_PAPERTRAIL environment variable / property which determines whether to use log4j or not. Of course, you can remove this part if you want.
- Java Log4j logging on help.papertrailapp.com
- Timbre configuration
- tools.logging
- Timbre source code for the default :output-fn