Heroku Log Drain

Your log data must not contain any personal data, such as names, email addresses, etc. It is your responsibility to ensure this data is filtered out before being sent to AppSignal, and when identifying a person is necessary that your application uses alternative forms of identification such as a user ID, hash, or pseudonym.

AppSignal can automatically ingest logs via Heroku Log Drain. We recommend using Logfmt as your log format, but we also accept JSON and Plaintext logs. You can find more information on formatting in our Log Formatting Documentation.

Remove old log drains

This Heroku log drain setup will send both logs and metrics to AppSignal. To send only metrics to AppSignal, follow the Heroku log drain setup in our Heroku documentation instead.

Before creating a new log drain for AppSignal, you need to remove any pre-existing AppSignal log drains. You can check for any existing active log drains using the command below, where myapp is the name of your Heroku application:

shell
heroku drains -a myapp

If there are any active AppSignal log drains, you can remove them using the following command:

shell
heroku drains:remove -a myapp <url>

Replace <url> above with the URL of the log drain you are trying to remove

Add new log drain

Once any active log drains have been removed, follow the instructions to create a Heroku log source.

Once you have created a log source, use the command below to create a new log drain.

shell
heroku drains:add "https://appsignal-endpoint.net/logplex?api_key=YOUR_LOG_SOURCE_API_KEY"

Replace YOUR_LOG_SOURCE_API_KEY with the key provided when creating a log source.

Due to how Heroku Log Drain logs are formatted, AppSignal cannot parse log severity information, resulting in AppSignal displaying all Heroku logs with the info severity level.

However, you can use the severity attribute to set the severity level of the log. For example: severity=error.

When connected, logs should appear in AppSignal. If you still cannot see any logs, please contact us for support.