Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4382352
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:46:06+00:00 2026-05-21T12:46:06+00:00

I need to prevent ActiveRecord#save from logging the content of large fields. Is there

  • 0

I need to prevent ActiveRecord#save from logging the content of large fields.

Is there a way to configure this on Rails 2.3.x?

@document.save #=> Will log something like:

Apr 20 13:45:42 ubuntu rails[2619]: Document::HTML Update (7.0ms)   UPDATE `documents` SET `some_meta_data` = 1, `more_meta_data` = 2, `document_content` = '\n\n\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional.....................'
Apr 20 13:45:42 ubuntu rails[2619]: SQL (5.8ms)   COMMIT

I don’t want the field document_content to be logged since is of type mysql ‘text’.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T12:46:07+00:00Added an answer on May 21, 2026 at 12:46 pm

    If you are using rails 3, do something like this in config/application.rb:

    config.filter_parameters += [:password, :document_content]
    

    Then restart your app. From that point on the log should show something like 'document_content' = [ FILTERED ] if memory serves me right.

    If you are using rails 2, you need to put the following inside your controller:

    filter_parameter_logging :document_content
    

    You can append a comma separated list of fields if needed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to prevent ActiveRecord from issued a SHOW FIELDS to the
I need to prevent duplicate names from been entered. This restriction needs to be
I need to prevent all CRM Online users from logging in for a short
I need to prevent a document from being saved / saved as (say from
I need to prevent a single user from writing to the Database, is there
I need to prevent users logging into my ASP.NET MVC application from multiple sessions,
Is there a way to prevent the default action from occurring when the user
I need to capture keystokes from a wedge device and prevent any controls or
Hey. I need to prevent direct access to http://www.site.com/wp-content/uploads/folder/something.pdf through the browser. However the
I have a complex table pulled from a multi-ActiveRecord object array. This listing is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.