The Rails::Rack::Logger middleware already logs each request on the URL level, and view rendering is being logged as well. However, requests to controller actions also display:
Processing by MyController#some_action as HTML
# ...view render logging...
Completed 200 OK in 12ms (...more info...)
We want the same kind of nice logging for Rodauth requests, to communicate to the developer that the RodauthApp middleware has indeed caught the request, what was response status, and how long the whole request took.
We implement this using the same approach that Action Pack uses to implement controller-level logging. Now the developer sees this for a Rodauth request:
Started GET "/create-account" for 127.0.0.1 at 2021-05-06 17:46:12 +0200
Processing by RodauthApp as HTML
# ...view render logging...
Completed 200 OK in 15ms (ActiveRecord: 0.0ms | Allocations: 2443)
The
Rails::Rack::Logger
middleware already logs each request on the URL level, and view rendering is being logged as well. However, requests to controller actions also display:We want the same kind of nice logging for Rodauth requests, to communicate to the developer that the RodauthApp middleware has indeed caught the request, what was response status, and how long the whole request took.
We implement this using the same approach that Action Pack uses to implement controller-level logging. Now the developer sees this for a Rodauth request: