Replies: 2 comments 10 replies
-
The main reason you're not seeing standard Rails request logging is because requests to Rodauth endpoints are not handled inside a controller, they are handled before the request even reaches the Rails router. There is some controller integration regarding callbacks and rescue blocks, but that doesn't trigger the logging. What you see is probably logging on the Rack middleware level, which is much more rudimentary than controller logging. I think what you're seeing a request being logged after it has been completed, but I could be wrong. Note that any middleware that handles requests will have this limitation, one other example being OmniAuth. I can investigate whether Rails provides some tools for improving logging of requests not handled by the Rails router. The first line of the logs would definitely need to be different, as the requests won't be handled by controller actions, but the rest doesn't seem controller-specific. |
Beta Was this translation helpful? Give feedback.
-
Awesome! It would be amazing to have standard Rails logs working for Rodauth-related requests. It looks like the way lograge does it is by attaching itself as an Feel free to ask if you want me to run some tests and test if it works fine with the various integrations we are using (lograte, datadog…) |
Beta Was this translation helpful? Give feedback.
-
Currently when a request is made to a Rodauth action, the start of the request is logged but not the after-request part.
If would be nice to have at least the "Completed …" row.
The first "Processing" row could be used to indicate that the request is handled by Rodauth as well.
I do not really understand how it is currently handled, but a quick search in Rails's code shows that this logging is done here:
https://github.com/rails/rails/blob/f95c0b7e96eb36bc3efc0c5beffbb9e84ea664e4/actionpack/lib/action_controller/log_subscriber.rb#L20
I also noticed that Rodauth requests are not showing in my production logs (using lograge) and I think this is related.
Do you think there can be an improvement here and there is a way to properly call the standard "after request" Rails code so all of this is handled like if it was a real Rails request? If you have ideas / pointers I can try things but for now I am not sure where to start and I dont know Rails/Rack/Rode internals enough.
I am also wondering if this may be related to the issue I just opened: #40
Beta Was this translation helpful? Give feedback.
All reactions