views:

205

answers:

1

I would like to make a global Zend_Log object that I can reach from my Controllers and my Models.

What should I add to my Bootstrap? (My bootstrap extends Zend_Application_Bootstrap)

How then can I reach the logger object from my controller actions and from my model?

+2  A: 

As you do with any other class - assign it to the Zend_Registy. I'd suggest setting like this:

Zend_Registry::set('Zend_Log',$logInstance);

This is a common way, which is used also for translate (set translate instance to 'Zend_Translate' and classes like forms and validators will find it automatically).

Tomáš Fejfar