In rails 6 and rails 7, active storage info logs are annoying and useless most of the time. For every image or variant, I get this much of garbage as logs, which is a burden to scroll and read the log to search for some issues. Moreover it fills up the log file faster than expected.
Every page that has 20 to 30 images requires a lot of lines in the log.
How can I disable or mute this type of log ActiveStorage?
I, [2023-08-11T15:45:06.317488 #667231] INFO -- : Started GET "/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDocWNtTjNkemgxZERaamVtazFZbWNWVU9oQmthWE53YjNOcGRHbHZia2tpWVdsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SWtsTlIxOHlNREl6TURneE1WOHhOVEV6TlRKZk9ERXdMbXB3WnlJN0lHWnBiR1Z1WVcxbEtqMVZWRVl0T0NjblNVMUhYekl3TWpNd09ERXhYekUxTVRNMU1sODRNVEF1YW5CbkJqc0dWRG9SWTI5dWRHVnVkRjkwZVhCbFNTSVBhVzFoWjJVdmFuQmxad1k3QmxRNkVYTmxjblpwWTJWZmJtRnRaVG9LYkc5allXdz0iLCJleHAiOiIyMDIzLTA4LTExVDE1OjUwOjA1LjY0M1oiLCJwdXIiOiJibG9iX2tleSJ9fQ==--4039552878eff65d1fcefc2a2beeb03f1056ca05/IMG_20230811_151352_810.jpg" for .... at 2023-08-11 15:45:06 +0000 I, [2023-08-11T15:45:06.318205 #667231] INFO -- : Processing by ActiveStorage::DiskController#show as JPEG I, [2023-08-11T15:45:06.318348 #667231] INFO -- : Parameters: {"encoded_key"=>"[FILTERED]", "filename"=>"IMG_20230811_151352_810"} I, [2023-08-11T15:45:06.318930 #667231] INFO -- : Completed 200 OK in 0ms (ActiveRecord: 0.0ms | Allocations: 184)
I tried several solutions on google, but none worked or helped
You can use lograge gem
# config/application.rb
Rails.application.configure do
config.lograge.enabled = true
config.lograge.ignore_actions = ['ActiveStorage::DiskController#show']
end
Logs from your answer will be hidden