# Logster and our error logging strategy at Discourse

DevFeed: [Logster and our error logging strategy at Discourse](<https://devfeed.tech/articles/logster-and-our-error-logging-strategy-at-discourse-22431.md>)

Original publisher: [Read original article](<https://samsaffron.com/archive/2018/12/27/logster-and-our-logging-strategy-at-discourse>)

Author: Sam Saffron

Published: 2019-01-02T07:11:20Z

Content type: article

Language: en

Sources: [Sam Saffron](<https://devfeed.tech/sources/sam-saffron.md>)

Topics: [log management](<https://devfeed.tech/topics/log-management.md>), [Logging](<https://devfeed.tech/topics/logging.md>), [Ruby](<https://devfeed.tech/topics/ruby.md>), [Ruby on Rails](<https://devfeed.tech/topics/ruby-on-rails.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [Redis](<https://devfeed.tech/topics/redis.md>), [Sidekiq](<https://devfeed.tech/topics/sidekiq.md>), [Grafana](<https://devfeed.tech/topics/grafana.md>), [nginx](<https://devfeed.tech/topics/nginx.md>), [Prometheus](<https://devfeed.tech/topics/prometheus.md>), [Docker](<https://devfeed.tech/topics/docker.md>)

Tags: [backend](<https://devfeed.tech/tags/backend.md>), [blog](<https://devfeed.tech/tags/blog.md>), [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [docker](<https://devfeed.tech/tags/docker.md>), [errors](<https://devfeed.tech/tags/errors.md>), [grafana](<https://devfeed.tech/tags/grafana.md>), [logging](<https://devfeed.tech/tags/logging.md>), [logs](<https://devfeed.tech/tags/logs.md>), [monitoring](<https://devfeed.tech/tags/monitoring.md>), [net](<https://devfeed.tech/tags/net.md>), [nginx](<https://devfeed.tech/tags/nginx.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [production](<https://devfeed.tech/tags/production.md>), [prometheus](<https://devfeed.tech/tags/prometheus.md>), [rails](<https://devfeed.tech/tags/rails.md>), [redis](<https://devfeed.tech/tags/redis.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [ruby-on-rails](<https://devfeed.tech/tags/ruby-on-rails.md>), [saffron](<https://devfeed.tech/tags/saffron.md>), [sam](<https://devfeed.tech/tags/sam.md>), [sidekiq](<https://devfeed.tech/tags/sidekiq.md>), [sql](<https://devfeed.tech/tags/sql.md>), [visibility](<https://devfeed.tech/tags/visibility.md>), [weblog](<https://devfeed.tech/tags/weblog.md>)

## AI overview

The article describes Discourse's logging strategy and Logster, an open-source log viewer for Ruby on Rails or Rack applications. It explains how Logster stores and analyzes logs with Redis, aggregates production errors, and provides detailed development logs, alongside broader monitoring and observability tools.

## Source excerpt

I have always been somewhat fascinated with logs. I tend to see the warning and error logs in production as a valuable heartbeat of an application. Proper handling of error logs is a very strong complement to a robust test suite. It shows us what really happens when real world data meets our application. 9 years ago, at Stack Overflow we had a daily ritual where we would open up our fork of ELMAH every morning and fish through our logs for problems. This had a dramatic positive effect on Stack Overflow. Almost 7 years into our journey building Discourse, every single week we find and fix issues in our application thanks to our error logs and Logster. Error logs are the pulse of our application, they let us know immediately if there are any urgent issues and where. Since we host more than 1500 sites running many different code branches, we needed to evolve a sane and robust set of practices and tools. Top level structure of logging and monitoring at Discourse We have lots of logs at Discourse and many systems for dealing with them. We keep raw Docker, Postgres, Redis, NGINX, Rails and HAProxy and so on in Elastic Search and use Kibana for business intelligence. We have a monitoring system built on alertmanager and Prometheus, with business intelligence in Grafana and alert escalation in our internal Discourse instance and opsgenie. We have logster which we use for web application aka. "Rails / Sidekiq" warnings and errors. I would like to focus on logster and our Rails / Sidekiq portion for this blog post, but think it is worth mentioning other mechanisms cause I don't want people to think we are not good data hoarders and only have very limited visibility into our systems. About Logster At Discourse we developed a log viewer called logster. Logster is a free and open source tool you can embed into any Ruby on Rails or Rack application in production and development. It runs as Rack middleware and uses Redis as its backend for log storage and analysis. It operates in