# How to Create logger

**URL:** <https://www.ruby-forum.com/t/how-to-create-logger/65832>\
**Category:** Engines\
**Created:** [February 11, 2006, 12:50pm UTC](https://www.ruby-forum.com/t/how-to-create-logger/65832 "2006-02-11T12:50:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 11, 2006, 12:50pm UTC](https://www.ruby-forum.com/t/how-to-create-logger/65832/1 "2006-02-11T12:50:41Z")

</div>

Hello,  
First of all congratulations and thanks for rail engines, it is  
extremely  
useful and make it even more fun to use ruby on rails.

The Engines Doc says that to use the engines logger one should call

Engines.create\_logger

But where should this call be ideally made? In applications.rb?

Second, what are the potential benefit of using engines logger instead  
of rails  
logger.

Thanks for your help.

–  
Surendra S.

[http://ssinghi.kreeti.com](http://ssinghi.kreeti.com), [http://www.kreeti.com](http://www.kreeti.com)  
Read the latest news at: [http://news.kreeti.com](http://news.kreeti.com)

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 11, 2006, 2:24pm UTC](https://www.ruby-forum.com/t/how-to-create-logger/65832/2 "2006-02-11T14:24:37Z")

</div>

The engine’s logger is simply a debug tool, and the main reason for  
creating it was to avoid adding noise to Rails’ default log. It should  
make it easier to debug the engine loading process. It’s also quite  
flexible in that you can set the logger to be the same as  
RAILS\_DEFAULT\_LOGGER should you with.

You can create the logger anywhere you like (before you do, the logger  
is actually set to be a dummy object that will accept any and all  
method calls silently, so you could set it to be any object you like  
in theory), but I’d suggest you create the logger in environment.rb  
unless there’s a good reason not to.

- james

On 2/11/06, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Second, what are the potential benefit of using engines logger instead of rails
> 
> * * *
> 
> engine-users mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org](http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org)

–

- J \*  
~

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 11, 2006, 6:55pm UTC](https://www.ruby-forum.com/t/how-to-create-logger/65832/3 "2006-02-11T18:55:45Z")

</div>

James A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

> unless there’s a good reason not to.

Thanks James.

> > But where should this call be ideally made? In applications.rb?  
> > Read the latest news at: [http://news.kreeti.com](http://news.kreeti.com)
> > 
> > * * *
> > 
> > engine-users mailing list  
> > removed\_email\_address@domain.invalid  
> > [http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org](http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org)
> 
> –
> 
> - J \*  
> ~

–  
[http://ssinghi.kreeti.com](http://ssinghi.kreeti.com), [http://www.kreeti.com](http://www.kreeti.com)  
Read the latest news at: [http://news.kreeti.com](http://news.kreeti.com)
