How to disable color ANSI escape codes in log rails 4

In my rails 4 logs I get the garbage log as follows:

^{[1m^{[36mPerson Load (0.7ms)^{[0m ^{[1mSELECT "people".* FROM "people" WHERE "people"."id" = $1 LIMIT 1^{[0m [["id", 673143]] 

How can I specify rails 4 to disable this coloring?

I tried adding config.active_record.colorize_logging = false to config/application.rb , but I got this error:

/home/sweerasinghe/trunk_1509171953/vendors/ruby-2.2.2/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/dynamic_matchers.rb:26:in `method_missing': undefined method `colorize_logging=' for ActiveRecord::Base:Class (NoMethodError)

+5
source share
1 answer

Do you want to:

 config.colorize_logging = false 

This is described in the Rails General Configuration section of the Rails Application Configuration Guide.

+12
source

Source: https://habr.com/ru/post/1232986/


All Articles