Question: Disable logging for column in activerecord/activejob 4.2

Question

Disable logging for column in activerecord/activejob 4.2

Answers 0
Added at 2016-12-10 14:12
Tags
Question

is there any way to disable logging for certain columns in ActiveRecord/ActiveJob?

I'm using delayed_job to queue mailing jobs with attachments, but when having activerecord debug enabled (I need to have it on) the log is filled with the INSERT statements with the attachments encoded.

I was looking a this answer http://stackoverflow.com/a/21731809/6712797 but it doesn't seem to work, as I understand because when entering the log_with_binary_truncate method the sql is already populated and the binds array is empty, don't know if has something to do in how ActiveJob works.

In summary, i need to have debug enabled, but not log some column, or trim them if they are long (as the link provided), and I'm not talking about request parameters.

Thanks in advance

Answers to

Disable logging for column in activerecord/activejob 4.2

Source Show
◀ Wstecz