johan
johan

Reputation: 2329

How to avoid a rails 3 app from saving in development.log?

I want to keep my rails 3 app from saving all the development logs in the development.log because its making my file bigger.

Upvotes: 4

Views: 1905

Answers (3)

skorks
skorks

Reputation: 4366

You can either do this in your:

application.rb

Or if you only want to disable for specific environments do this in the specific env config, in your case:

config/environments/development.rb

You're probably looking for some or all of the following settings:

config.logger
config.active_record.logger
config.action_controller.logger
config.action_view.logger
config.action_mailer.logger
config.active_resource.logger

If you set any of them to nil e.g.:

config.active_record.logger = nil

It should disable logging for that specific component. You can experiment with these to disable logging for specific components or set all of them to nil to get no logging.

Upvotes: 7

ryyppy
ryyppy

Reputation: 442

Normally, in a rails-app, there is a configuration-file, where you can set development-, production-, staging - specific configuration-data for logging, database-binding, bootstraps,... Maybe you check these file, if there are no attributes defined for logging, check out, if you´re logging-level is set to the appropriate value.

Link: Click

greets

Upvotes: 2

GrahamJRoy
GrahamJRoy

Reputation: 1643

Switching it entirely off is a very bad idea. You can make it put less transactions in it by specifying a log level like:

config.log_level = :info

in the config/environments/development.rb file. For the various options look here:

http://guides.rubyonrails.org/configuring.html

Upvotes: 6

Related Questions