How can I exclude email texts from the log?

hi

does anyone know how to prevent email texts to be written in the logs?
date, from, to, cc, bcc, subject, etc should stay in the log, only the
body to be excluded.

thanks

Luma

Processing LoginController#register (for 127.0.0.1 at 2008-04-04
23:30:25) [POST]

Sent mail:
Date: Fri, 4 Apr 2008 23:30:27 +0200

From: …

To: …

Subject: …

Mime-Version: 1.0

Content-Type: text/plain; charset=utf-8

… some quite long text …

Redirected to http://localhost:3000/login/login

Hi Luma,

Luma

does anyone know how to prevent email texts
to be written in the logs?

The filter_parameter_logging method should do what you need. Something
like…

filter_parameter_logging { |k,v| v.replace ‘’ if k == ‘email_body’}

It lives in ActionController::Base at api.rubyonrails.org.

HTH,
Bill

On 15 Apr 2008, at 11:41, Luma wrote:

perhaps it will be easier to ban emails completely from the log files.
How can I do that?

It’s not super nice but we’ve got this in our production.rb:
config.action_mailer.logger = nil

Fred

does anyone know how to prevent email texts to be written in the logs?
date, from, to, cc, bcc, subject, etc should stay in the log, only the
body to be excluded.

well, the logs also shouldn’t contain email-attachments (which need
most space).

perhaps it will be easier to ban emails completely from the log files.
How can I do that?

Luma