How to Create logger

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://www.kreeti.com
Read the latest news at: http://news.kreeti.com

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, [email protected] [email protected] wrote:

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


engine-users mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org

  • J *
    ~

James A. [email protected] 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


engine-users mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org

  • J *
    ~


http://ssinghi.kreeti.com, http://www.kreeti.com
Read the latest news at: http://news.kreeti.com