Per https://discourse.zendframework.com/t/validatormanager-not-calling-custom-validator-factory/109/5?u=matthew the log_processors, log_writers, log_filters, and log_formatters config keys are not honored currently unless the application is within a zend-mvc context. This is due to the fact that Zend\Log\Module wires configuration for the Zend\ModuleManager\Listener\ServiceListener in order to push merged service configuration into the plugin during bootstrap; no similar logic is available when not in a zend-mvc context, however.
This patch fixes that situation by modifying each of the ProcessorPluginManagerFactory, WriterPluginManagerFactory, FilterPluginManagerFactory, and FormatterPluginManagerFactory to do the following:
If a ServiceListener service exists, it returns the plugin manager immediately (old behavior).
Otherwise, it checks for the config service, and, if found, the relevant key (log_processors, log_writers, log_filters, or log_formatters) with an array value. When found, it feeds that value to a Zend\ServiceManager\Config instance and uses that to configure the plugin manager before returning it.
Per https://discourse.zendframework.com/t/validatormanager-not-calling-custom-validator-factory/109/5?u=matthew the
log_processors
,log_writers
,log_filters
, andlog_formatters
config keys are not honored currently unless the application is within a zend-mvc context. This is due to the fact thatZend\Log\Module
wires configuration for theZend\ModuleManager\Listener\ServiceListener
in order to push merged service configuration into the plugin during bootstrap; no similar logic is available when not in a zend-mvc context, however.This patch fixes that situation by modifying each of the
ProcessorPluginManagerFactory
,WriterPluginManagerFactory
,FilterPluginManagerFactory
, andFormatterPluginManagerFactory
to do the following:ServiceListener
service exists, it returns the plugin manager immediately (old behavior).config
service, and, if found, the relevant key (log_processors
,log_writers
,log_filters
, orlog_formatters
) with an array value. When found, it feeds that value to aZend\ServiceManager\Config
instance and uses that to configure the plugin manager before returning it.