# Binary / ESC in dev log

**URL:** <https://www.ruby-forum.com/t/binary-esc-in-dev-log/73133>\
**Category:** Rails\
**Created:** [October 21, 2006, 9:04pm UTC](https://www.ruby-forum.com/t/binary-esc-in-dev-log/73133 "2006-10-21T21:04:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@joe](https://www.ruby-forum.com/u/joe)\
**Post date:** [October 21, 2006, 9:04pm UTC](https://www.ruby-forum.com/t/binary-esc-in-dev-log/73133/1 "2006-10-21T21:04:25Z")

</div>

My production log looks okay, but when I less my development log it  
first asks ‘“log/development.log” may be a binary file. See it anyway?’  
and it looks like this:

ESC[4;35;1mSQL (0.075510)ESC[0m ESC[0m SELECT a.attname,  
format\_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull  
FROM pg\_attribute a LEFT JOIN pg\_attrdef d  
ON a.attrelid = d.adrelid AND a.attnum = d.adnum  
WHERE a.attrelid = ‘sites’::regclass  
AND a.attnum \> 0 AND NOT a.attisdropped  
ORDER BY a.attnum  
ESC[0m

What’s with the ESC’s? Do I need to change some setting?

Thanks,  
Joe

---

<div class="post-metadata">

**Author:** ![joe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@joe](https://www.ruby-forum.com/u/joe)\
**Post date:** [October 21, 2006, 9:37pm UTC](https://www.ruby-forum.com/t/binary-esc-in-dev-log/73133/2 "2006-10-21T21:37:03Z")

</div>

Those are ANSI color codes.

In your environment.rb (with a recent Rails):

Rails::Initializer do |config|  
(…)  
config.active\_record.colorize\_logging = false  
(…)  
end

See [http://glu.ttono.us/articles/2006/05/22/configuring-rails-](http://glu.ttono.us/articles/2006/05/22/configuring-rails-)  
environments-the-cheat-sheet for a good list of configuration options.

–  
Brad E.  
Cell 479 228-1710

---

<div class="post-metadata">

**Author:** ![joe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@joe](https://www.ruby-forum.com/u/joe)\
**Post date:** [October 21, 2006, 10:21pm UTC](https://www.ruby-forum.com/t/binary-esc-in-dev-log/73133/3 "2006-10-21T22:21:54Z")

</div>

Ahh…thanks! Looks like more handles them by default whereas less  
requires the -R option. Though it still prompts me if I want to see a  
binary file – I can’t figure out how to make that go away.

Joe
