Heroku Logs

You can send your Heroku logs by adding a drain to Loggly. We will automatically parse the logs as well. For alternatives on Heroku log analysis, please see the Advanced Options section.

Heroku Logging Setup

  1. Add A Drain
  2. Use drain to send your heroku application logs to loggly. Follow below command to send logs.

    heroku drains:add http://logs-01.loggly.com/bulk/TOKEN/tag/heroku --app HEROKU_APP_NAME
    

    Replace:

    • TOKEN: your customer token from the source setup page
    • HEROKU_APP_NAME: the name of your Heroku application

  3. Send Test Logs
  4. Send some test logs to Loggly. If you’re using a logger library in your respective technology, set it up on Heroku to log to stdout.

    Ruby sample

    puts 'hello logs'
    

    Java sample

    System.out.println("hello logs");
    

  5. Verify Events
  6. Search Loggly for events with the heroku tag over the past 20 minutes. It may take a few minutes to index the event. If it doesn’t work, see the troubleshooting section below.

    tag:heroku

    heroku_router_output
    Click on one of the logs to show a list of syslog fields. If you don’t see them, please check that you are using one of our automatically parsed formats.

Advanced Heroku Logging Options

Troubleshooting Heroku Logs

If you don’t see any data show up in the verification step, then check for these common problems.

    Check heroku:

  • Wait a few minutes in case indexing needs to catch up
  • Run the “heroku drains” command to verify Heroku has created the drain
  • Run the “heroku logs” command to verify Heroku has received the logs you sent
  • Try curling an event to the bulk endpoint to verify Loggly is able to receive your events
  • Still Not Working?

  • Search or post your own question in the community forum.
Thanks for the feedback! We'll use it to improve our support documentation.


Top