roidrage/lograge

Confused about what Rails logging is eliminated

Opened this issue · 1 comments

Rails 7.1.1, lograge 0.14.0

In the dev environment, with lograge enabled and config.lograge.keep_original_rails_log = true, I see the following, which is expected:

22:24:44 web.1     | Started GET "/widgets" for 172.24.0.1 at 2023-10-29 22:24:44 +0000
22:24:44 web.1     | Processing by WidgetsController#index as HTML
22:24:44 web.1     |   Rendering layout layouts/application.html.erb
22:24:44 web.1     |   Rendering widgets/index.html.erb within layouts/application
22:24:44 web.1     |   Widget Load (0.8ms)  SELECT "widgets".* FROM "widgets"
22:24:44 web.1     |   ↳ app/views/widgets/index.html.erb:3
22:24:44 web.1     |   Rendered widgets/index.html.erb within layouts/application (Duration: 18.0ms | Allocations: 11805)
22:24:44 web.1     |   Rendered layout layouts/application.html.erb (Duration: 56.6ms | Allocations: 57289)
22:24:44 web.1     | Completed 200 OK in 187ms (Views: 53.8ms | ActiveRecord: 4.6ms | Allocations: 347803)
22:24:44 web.1     | 
22:24:44 web.1     | 
22:24:44 web.1     | method=GET path=/widgets format=html controller=WidgetsController action=index status=200 allocations=347803 duration=187.49 view=53.83 db=4.58 request_id=4d90be0b-3f9f-4b10-8399-84700704321a foo=bar

When I change keep_original_rails_log to false, I still see stuff from Rails view. Same request as above generated this log:

22:26:00 web.1     |   Rendering layout layouts/application.html.erb
22:26:00 web.1     |   Rendering widgets/index.html.erb within layouts/application
22:26:00 web.1     |   Widget Load (0.6ms)  SELECT "widgets".* FROM "widgets"
22:26:00 web.1     |   ↳ app/views/widgets/index.html.erb:3
22:26:00 web.1     | method=GET path=/widgets format=html controller=WidgetsController action=index status=200 allocations=347430 duration=155.47 view=46.70 db=3.14 request_id=f0467c6d-0ef3-4bd9-89f6-af75a6dd906a foo=bar

What I'm confused about is that I would not expect the "Rendering layout", "Rendering widgets", or the down-right arrow log lines when I have keep_original_rails_log set as false. Should those have been eliminated?

owst commented

@davetron5000 what output do you see with Rails 7.0.8? I suspect that the "Rendering" lines are the same cause as #385 but I'm not sure if the other lines are intended to be suppressed