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

Add ActionController::Base.log_at #37289

Merged
merged 1 commit into from Sep 24, 2019
Merged

Add ActionController::Base.log_at #37289

merged 1 commit into from Sep 24, 2019

Conversation

georgeclaghorn
Copy link
Contributor

@georgeclaghorn georgeclaghorn commented Sep 24, 2019

Allow setting a different log level per request.

# Use the debug level if a particular cookie is set.
class ApplicationController < ActionController::Base
  log_at :debug, if: -> { cookies[:debug] }
end

Allow setting a different log level per request.
@georgeclaghorn georgeclaghorn marked this pull request as ready for review Sep 24, 2019
@georgeclaghorn georgeclaghorn merged commit 75a5329 into rails:master Sep 24, 2019
2 checks passed
@georgeclaghorn georgeclaghorn deleted the log-at branch Sep 24, 2019
@rafaelfranca
Copy link
Member

@rafaelfranca rafaelfranca commented Sep 24, 2019

This is a great addition! Thank you George.

@kaspth
Copy link
Contributor

@kaspth kaspth commented Sep 24, 2019

Sweet! Should we change the log level default in production back to info now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants