Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to log the before_action method that halt the request? #258

Open
benoittgt opened this issue Sep 7, 2018 · 0 comments · May be fixed by #259 or #375
Open

How to log the before_action method that halt the request? #258

benoittgt opened this issue Sep 7, 2018 · 0 comments · May be fixed by #259 or #375

Comments

@benoittgt
Copy link

Hello

I would like to know if it's possible to get the before_action that stop the request?
Does the key is inside the unsubscribing of ActiveSupport::Notifications ?

lograge/lib/lograge.rb

Lines 111 to 113 in 0e1ed04

ActiveSupport::Notifications.notifier.listeners_for("#{event}.#{component}").each do |listener|
if listener.instance_variable_get('@delegate') == subscriber
ActiveSupport::Notifications.unsubscribe listener

Thanks

@benoittgt benoittgt linked a pull request Sep 10, 2018 that will close this issue
benoittgt added a commit to benoittgt/lograge that referenced this issue Sep 28, 2023
Fix roidrage#258

Sometimes when you do the final render or redirection, it can be halted by a controller callback. With the existing code, it can very hard to understand where it stopped.

With this commit, the intent is to provide the method name where it stops.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant