views:

65

answers:

1

Is there any way to tell active record not to log the ansi color codes when its logging stuff?

Eg. I do not want this in my logs.

[4;36;1mSQL (0.1ms)[0m   [0;1mSELECT count(*) AS count_all FROM `users` WHERE (`user`.id = 133) [0m

Instead I want this:

SQL (0.1ms) SELECT count(*) AS count_all FROM `users` WHERE (`user`.id = 133)

I am not looking for a solution that involves cleaning up the mess after the fact.

+5  A: 

Add this to your appropriate environment file (in my case development.rb)

config.active_record.colorize_logging = false
Sam Saffron