Configuring centralized logging from Erlang apps

Papertrail can accept logs from any Erlang (BEAM) app, with or without the lager logging library.

Method A: Use log file

Configure your Erlang app to log to a file as usual, then use remote_syslog2 to watch that file. Setup instructions.

Method B: Send remote syslog from Erlang app

Alternatively, your app can send a log message directly to Papertrail using the remote syslog protocol.

To do this, add schlagert/syslog to the app and point it at Papertrail. See Add Systems for dest_host and dest_port log destination values. Use either protocol RFC; if in doubt, choose rfc5424.

Since schlagert/syslog is emitting UDP, which is inherently connection-less, the write calls are non-blocking.

Alternative: lager

Erlang applications which already use the lager logging library can configure it to also log to syslog. See lager_syslog, which will send logs to a syslog daemon running on the local host (such as rsyslog or syslog-ng). Follow standard setup to configure the syslog daemon to forward to Papertrail.