Best Log Management Tools for Elixir Phoenix

Once you’ve deployed your Elixir Phoenix app to your users, it’s critical you capture logs using a log management tool to help debug errors and understand how your users are experiencing your app. Logging keeps a record of data inputs, processes, data outputs, and final results in a program. With a log management tool, you can traverse through log history and find out exactly where the application is having problems. Log Management along with Error Monitoring are the first services you should add to a production application to give you insight into how your system is operating in production.

Based on our five years of experience with Phoenix in production and extensive testing, we determined that these are the three Elixir error monitoring services you should use for your Phoenix applications. The overall best error monitoring service to integrate into your Elixir app is Logflare.

What are the best error monitoring services for Elixir Phoenix?

  1. LogflareEditor’s Choice
  2. PapertrailBest for Heroku apps
  3. LogtailBest for logging multiple languages and platforms

#1. Logflare

Sign Up for Free Trial | Editor’s Choice

logflare log management

Pros and cons

Pros

  • Extremely simple to set up with Gigalixir
  • Focused on easy integration with both Gigalixir and Elixir
  • Comprehensive documentation and email support from developers

Cons

  • Does not offer easy integrations with other languages like Ruby, Python, or Go.
Sign Up for Free Trial

Our experience with Logflare

We signed up for a Logflare account using our GitHub account. We named our Logflare source HelloGigalixir.all.

logflare setup

After we saved our source, Logflare gave us the Gigalixir CLI command to set up our log drain, including the API key.

logflare gigalixir drains

We pasted the command into the terminal from our project directory and the drain was set up on Gigalixir.

gigalixir drains

We opened our HelloGigalixir app deployed on Gigalixir to add a user and click around. The log messages immediately appeared on Logflare.

Ease of Use

If your app is deployed to Gigalixir, getting set up will take you less than 5 minutes. Logflare will guide you through the set up with an excellent onboarding process. It doesn’t have a bunch of additional services and features you have to comb through to figure out how to set up logging.

If you aren’t deployed to Gigalixir, they offer an open source Elixir Logger Backend called LogflareLogger. We chose to use drains because we didn’t have to update our app’s logger configuration.

Available Features

Logflare has all the features you need to manage your logs. Logflare is backed by Google BigQuery. They immediately insert your logs into BigQuery and store those there for 7 days. You can make dashboards with Google Data Studio using your new BigQuery table.

You can route logs to difference sources with Regex. Also, you can consolidate important events with log routing.

As we covered in our Logging in Elixir with Logger article, you can include metadata with your event for logging structured data. Then you can query this structured logging data with standard SQL in BigQuery.

Finally, it is possible to send alerts to a variety of third-party services like email, SMS, Slack, or Discord.

Documentation / Support

The documentation is extensive and is focused on Elixir-specific guides and issues. The onboarding flow guides you through the easy set up process with Gigalixir or their Custom Elixir Backend. They also provide a link to a series of video tutorials about how to use Logflare when you sign up.

Support is exceptional. We emailed a question to support and quickly got a response from the founder. Some of the other options don’t provide any email support (and even Twitter DMs are closed).

Conclusion

The Logflare team is focused on providing a log management solution to Elixir developers. You can even see the status dashboard for their Elixir backend. We like to support Elixir companies and the first-hand experience means better features for Elixir devs. Support and documentation are exceptional. Logflare is the best overall log management service for Elixir.

Sign Up for Free Trial

#2. Papertrail

Sign Up for Free Trial | Best for Heroku apps

papertrail-log-management

Pros and cons

Pros

  • Extremely simple to set up with Gigalixir (using Heroku instructions)
  • One-click integration with Heroku
  • Works with nearly all common web frameworks, logging libraries, and languages

Cons

  • May become very expensive at large scale
Sign Up for Free Trial

Our experience with Papertrail

We signed up for a Papertrail account. We clicked the first step in the onboarding to add a new system.

papertrail add logging system

We clicked the drop downs to set up Papertrail for app log files and Heroku. Heroku and Gigalixir CLIs use the same convention for adding drains. Papertrail gave us the Heroku CLI command to set up our log drain, including the API key.

papertrail loggin setup

We replaced heroku with gigalixir. Then we pasted the command into the terminal from our project directory. We opened our HelloGigalixir app deployed on Gigalixir to add a user and click around. Papertrail notified us it received the first log message. When we visited the list of events from the Papertrail Dashboard, the log messages were available to search.

Ease of Use

If your app is deployed to Gigalixir, getting set up will take you less than 5 minutes. Papertrail will guide you through the set up with an excellent onboarding process.

If you aren’t deployed to Gigalixir, they offer an open source Elixir Logger Backend called LoggerPapertrailBackend.

Available Features

Papertrail has everything you need to manage your logs. These features include live tail, seek by time, context, elegant search, APM integration, ANSI color support, saved searches, and log velocity analytics.

It is also possible to send alerts to a variety of third-party services like email, PagerDuty, Slack, or Zapier.

Finally, Papertrail works with nearly all common web frameworks, logging libraries, languages, and daemons

Documentation / Support

The documentation is solid and includes Elixir-specific guides and issues. The onboarding flow guides you through the easy set up process with a wide variety of frameworks and languages.

Papertrail provides support via a online chat available during normal business hours.

Conclusion

Papertrail is a solid choice that has been around for a while. We’ve used it in production for years and it met our needs. It is easy to set up with Gigalixir. With Heroku, it is a one-click add-on. Some of the product reviews we found said it can become expensive as you scale, especially compared to some of our other options. Papertrail is the best for Heroku apps.

Sign Up for Free Trial

#3. Logtail

Sign Up | Best for logging multiple languages and platforms

logtail log management

Pros and cons

Pros

  • Relatively easy to set up with Gigalixir (using Heroku instructions)
  • Works with many other common web frameworks, logging libraries, and languages

Cons

  • No Elixir custom backend to integrate directly in app
Sign Up for Logtail

Our experience with Logtail

We signed up for a Logtail account which required a credit card. However it does offer a 60 day money back guarantee. The sign up process leaves you at billing, so you have to click to add a source.

logtail source

We named the source HelloGigalixir and clicked Heroku as the platform. As we mentioned before, Heroku and Gigalixir CLIs use the same convention for adding drains. Logtail gave us the Heroku CLI command to set up our log drain, including the API key.

logtail setup

We replaced heroku with gigalixir. Then we pasted the command into the terminal from our project directory. We opened our HelloGigalixir app to update a user and click around. Logtail notified us it received the first log message. When we visited the Live Tail from the Logtail Dashboard, the log messages were available to search.

Ease of Use

If your app is deployed to Gigalixir, getting set up will take you less than 5 minutes. Once you click to add a source, Logtail will guide you through the setup.

We weren’t able to find a Custom Elixir Backend, but they also provide instruction for integrating with Render or a REST HTTP API.

Available Features

Logtail has what you need to manage your log information. These features include storing logs in a structured form instead of a blob of text. With structure data, you can do more with your logs than full-text search. You can also build dashboards with Grafana to manage application performance and metrics.

It is also possible to send alerts via Slack. It appears to have fewer integrations than some of the other services we reviewed.

Finally, Logtail works with many common web frameworks, logging libraries, languages, and daemons.

Documentation / Support

The documentation is solid for the frameworks and languages it supports. Once you click to add a source, it provides instruction for setup.

Logtail provides support via email with responses from their engineers. According to the website, the response time is usually within a few hours.

Conclusion

Logtail is a good choice if you deploy to Gigalixir or Render. It is easy to set up with these services. However, it’s Elixir-specific support is limited. Logtail is the best for logging multiple languages and platforms.

Sign Up for Logtail

Frequently Asked Questions

What other services did you consider?

We also looked at Sematext, Logentries, Logz.io, Datadog, New Relic, and Sumo Logic. While these services all provided a way to track errors in your Phoenix application, the lack of Elixir documentation made it clear Elixir is not a strong focus for these companies. Many of these companies are more enterprise-focused, so their onboarding was not as simple and smooth.

What is the difference between error monitoring and log management services?

Error monitoring services notify you when your users find a bug, error, or exception in your software. Along with the notification, the service will provide debugging information so you don’t have to search through your logs. Log management services save your production logs and make them available for search and analysis. You can use the logging system to find information about an error or warning message. Also, you can see steps a user took when using your app.

What are the best ways to debug my code once I find an error in my logs?

The simplest approach is to use IO.inspect/2 to identify bugs in your code after you receive an error or warning message. If you want to learn about some other methods, check our article Debugging Elixir Phoenix: Beyond IO.inspect/2.

How can I configure Elixir’s Logger tool?

Elixir’s Logger allows you to configure log levels, logger backends, sync and async modes, and the log format template. For details on how to configure logger and when to use log calls, we cover what you need to know about logging in Elixir with Logger. The article also discusses Elixir’s logger backends, Elixir custom backends, when the console backend ignores a certain log level, and adjusting the log level in production.

Methodology

We conducted extensive research into the options for Elixir and Phoenix. We looked for services with Elixir specific documentation and setup.

During evaluation, we used the app we deployed to Gigalixir in our Deploy Phoenix to Gigalixir using Releases article. We created an account with each service and followed the instructions to configure the log drain to the service.

With that setup, we clicked around the app to simulate a user visiting our site. Finally, we examined the logs in the dashboard and looked at options for searching and analyzing the logs.

Rating Criteria

We assessed each platform in three areas:

  • Ease of Use
  • Available Features
  • Documentation / Support

Ease of Use

Ideally, the service will provide a good user experience (UX) to help you get up and running quickly and easily. The best services will have resources designed to make setting up the service for Phoenix applications as seamless as possible.

Available Features

The best contenders will offer notifications and other logging options that can meet the needs of your application.

Additionally, these platforms will provide a dashboard with real-time data including your logs with the ability to search and analyze the data. Plus it will have easy integration for notifications using other tools.

Documentation / Support

The best services will have Elixir and Phoenix specific documentation with FAQs addressing common issues.

For support, we expect companies to offer help via email or help ticket. If we needed assistance, we made a note about the responsiveness of our request.

Services get a bonus for having a large collection of community-developed guides and other content available for use and troubleshooting.

Want To Know How To Deploy Phoenix Apps Using A single Command?

This brand-new FREE training reveals the most powerful new way to reduce your deployment time and skyrocket your productivity… and truly see your programming career explode off the charts!