Rails provides filter_parameter_logging to filter sensitive parameters from the rails log.
If you have a a JSONP API, some sensitive information could be present in the URL. Is there a way to filter request URLS from the log also?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Note: The answer here was the way to get it work on Rails 2.x ~> 3.0. Starting from Rails 3.1, if you set
config.filter_parameters, Rails will filter out the sensitive parameter in the query string as well. See this commit for more detail.I think in that case, you need to override
complete_request_uriin ActionController::Base, since ActionController::Benchmarking calls that method and prints the line that looks like:I think you can put this in initializer to override this method
Note that you need to play a bit with regular expression to make it substitute the portion you wanted.