As @archaelus told, there is currently no lager
syslog adapter with remote protocol support.
Another approach seems to use lager
to log to a file:
{lager, [
{handlers, [
{lager_file_backend, [{file, "info.log"}, {level, info}]}
]}
Then uses remote_syslog2
to forward this log file Papertrail.
For that download and install the latest remote_syslog2 binary (instructions).
Add a /etc/log_files.yml
config file with:
files:
- /path/to/your/app/log/info.log
destination:
host: logs.papertrailapp.com
port: 1234
protocol: tls
pid_file: /var/run/remote_syslog.pid
And finally the remote_syslog2 deamon: sudo remote_syslog
You can also check the documentation page Papertrail has created for centralizing Erlang logs.
For Loggly, there is a dedicated Lager adapter: lager_loggly.