Skip to content
This repository has been archived by the owner on May 16, 2018. It is now read-only.

Zend_Application add Log to Translate, Cachemanager #103

Closed
wants to merge 3 commits into from
Closed

Zend_Application add Log to Translate, Cachemanager #103

wants to merge 3 commits into from

Conversation

croensch
Copy link
Contributor

I'd like to configure my loggers for Translate and Cachemanger for example via Zend_Config_Ini. Naturally the log array will be passed to the resource, resulting in an exception that it's not an instance of Zend_Log. So i added some checks in these resources to make them so.

This is a purely optional feature, please take consideration to add it.

Some documentation, not yet included:

Zend_Application_Resource_Translate
The following configuration keys are recognized:
log : Configuration will be passed to the Zend_Log::factory() method, allowing you to specify combinations of log writers and filters.

Zend_Application_Resource_Cachemanager
Example #2 Logger configuration

resources.cachemanager.database.frontend.options.logger.stream.writerName = "Stream"
resources.cachemanager.database.frontend.options.logger.stream.writerParams.stream = APPLICATION_PATH "/../data/logs/application.log"
resources.cachemanager.database.frontend.options.logger.stream.writerParams.mode = "a"
resources.cachemanager.database.frontend.options.logger.stream.filterName = "Priority"
resources.cachemanager.database.frontend.options.logger.stream.filterParams.priority = 4

Initial source: https://github.com/croensch/zendcastle/

croensch added 3 commits May 15, 2013 18:51
Zend_Application_Resource_Translate: option 'log' should use
Zend_Log::factory(), if provided as array.
Zend_Application_Resource_Cachemanager: frontend option 'logger' should
use
Zend_Log::factory(), if provided as array.
If $options['log'] was not an array, $log could be undefined before
instanceof.
@froschdesign
Copy link
Member

@croensch
Why different index names? "log" vs. "logger"

  • Zend_Application_Resource_Translate: $options['log']
  • Zend_Application_Resource_Cachemanager: $value['frontend']['options']['logger']

@croensch
Copy link
Contributor Author

@froschdesign
I know it looks odd. The index names are the same as the component specifies. You can already pass "log" to Zend_Translate, as well as "logger" to Zend_Cache_Manager. So i rather kept the consistency between the resource and the component than between the resources itself.

@froschdesign
Copy link
Member

Ah, okay.

Thanks for your feedback.

@ghost ghost assigned froschdesign Jan 3, 2014
@froschdesign
Copy link
Member

Thanks! 😄

xopherdeep pushed a commit to xopherdeep/Zend-Framework-v1 that referenced this pull request Jul 3, 2014
…chemanager

Thanks for the PR to @croensch!
I fixed only an unit test.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants