# Logger::Format not defined (NameError) \[NOOB\]

**URL:** <https://www.ruby-forum.com/t/logger-format-not-defined-nameerror-noob/56344>\
**Category:** Rails\
**Created:** [March 30, 2006, 12:11pm UTC](https://www.ruby-forum.com/t/logger-format-not-defined-nameerror-noob/56344 "2006-03-30T12:11:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neil\_Bain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/4da419/32.png) [@Neil\_Bain](https://www.ruby-forum.com/u/Neil_Bain)\
**Post date:** [March 30, 2006, 12:11pm UTC](https://www.ruby-forum.com/t/logger-format-not-defined-nameerror-noob/56344/1 "2006-03-30T12:11:27Z")

</div>

I have just installed apache2 / php4 / mysql and RoR on a clean and  
minimal Ubuntu (5.10) server.

I have set up a test site and can reach the “Welcome on board” index  
page.

However when I run “ruby script/generate contoller firsttest” I get the  
following error.

./script/…/config/…/vendor/activesupport/lib/active\_support/clean\_logger.rb:13:in  
`remove\_const’: constant Logger::Format not defined (NameError)  
from  
./script/…/config/…/vendor/activesupport/lib/active\_support/clean\_logger.rb:13  
from  
./script/…/config/…/vendor/activesupport/lib/active\_support.rb:31  
from ./script/…/config/environment.rb:50  
from script/generate:4

I believe that this can be patched using this patch at  
[http://dev.rubyonrails.org/ticket/2245](http://dev.rubyonrails.org/ticket/2245)

Two questions. Is this the right course of action and (as a complete  
newbie) how do you apply a patch?

Thanks for any assistance.

Neil

---

<div class="post-metadata">

**Author:** ![Neil\_Bain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/4da419/32.png) [@Neil\_Bain](https://www.ruby-forum.com/u/Neil_Bain)\
**Post date:** [March 30, 2006, 12:52pm UTC](https://www.ruby-forum.com/t/logger-format-not-defined-nameerror-noob/56344/2 "2006-03-30T12:52:59Z")

</div>

OK… Sorry to waste everyones time… I have solved this myself by  
engaging my brain. For anyone else with the same problem here is the  
fix.

Edit the file ./vendor/activesupport/lib/active\_support/clean\_logger.rb  
(the clue is in the error message!!) and comment out the line 13 so that  
it reads:

> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >

require ‘logger’

class Logger #:nodoc:

# Silences the logger for the duration of the block.

def silence(temporary\_level = Logger::ERROR)  
old\_logger\_level, self.level = level, temporary\_level  
yield  
ensure  
self.level = old\_logger\_level  
end

private

# remove\_const “Format”

```
Format = "%s\n"
def format_message(severity, timestamp, msg, progname)
  Format % [msg]
end

```

end

> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >

The error message was produced because the constant Format did not exist  
and therefore cannot be removed!!

Neil
