Fix production logging: disable Sentry debug, drop log_level to info - #887
Merged
Merged
Conversation
Sentry's config.debug = true logged the SDK's full outgoing event
JSON (including every loaded gem's version, hundreds of entries) at
DEBUG level on every captured error - single lines up to ~485KB, past
Loki's 256KB per-entry limit, causing Loki to drop the whole batch and
silently lose real log lines alongside it.
Rails' own config.log_level was still at the stock :debug default
(never actually set for this app), which is the root source of the
constant DEBUG-level query/permission-check noise. Matches pals'
existing ENV.fetch("RAILS_LOG_LEVEL", "info") pattern.
ShanaLMoore
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
config.debug = truefrom the Sentry initializer.config.log_leveltoENV.fetch("RAILS_LOG_LEVEL", "info"), matching pals' existing pattern - was still on Rails' stock:debugdefault.Why
Found while investigating why some of utk-hyku's application logs weren't reliably reaching Loki. With Sentry's
debug: true, the SDK logs its full outgoing event payload - including amoduleshash of every loaded gem and version, hundreds of entries - as a single DEBUG log line every time an error is captured. These lines run 100KB-485KB+, well past Loki's 256KB per-entry limit, so Loki rejects the entire batch each time (max entry size '262144' bytes exceeded) - meaning legitimate log lines batched alongside the oversized one get silently dropped too.Separately,
config.log_level = :debugwas still Rails' unmodified generator default (never actually set deliberately for this app) - the real source of the constant ActiveRecord/CanCan DEBUG-level noise seen throughout. pals (palni_palci_knapsack) already usesENV.fetch("RAILS_LOG_LEVEL", "info"); this brings utk-hyku in line.🤖 Generated with Claude Code