0

How can I disable the console output on a Rails 3 application? More specifically, I want to disable at least the Mailer output, that outputs the entire email content, including the pictures, making the action processing much slower (it takes almost 10sec to send an email).

ps: I think the slowdown is because of the output, if it can be from another source, such as slow smtp server (it's gmail atm, so no.) or something else like that please let me know.

3 Answers 3

6

By this you mean you want to hide the output shown in the console run you run rails s (or script/server in rails 2)?

Are you on Linux or OSX?

If so, then just do the following

$ rails server 1> /dev/null

this sends all output from stdout into a blackhole.

So right now you are trying to send emails from your dev machine? I try to avoid this, as accidents are going to happen and you'll send clients test data.

Try Mailcatcher http://mailcatcher.me/

It lets you catch all the emails your app would be sending shows them off in a nice web interface and importantly avoids the risk of accidentally sending real emails to customers with random test data.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, doing so did improve processing time from 6~7s to 4~5s. Not much, but it helps. Also, we're already using MailInterceptor to make sure no client receive any emails.
0

SMTP server's (even Gmail) response can really take some time. You'd rather use a mail queue that stores all emails in a database and then they are sent by an independent process.

E.g. https://github.com/beam/action-mailer-queue

Concerning logger - make sure that your logging level is :error or :fatal. If not, run:

config.log_level = :error

1 Comment

I don't think that's a good idea for me, I may use something like background processing, but not queues. Thanks anyway
0
config.logger = Logger.new('log/development.log')

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.