Closed Sohorev closed 4 years ago
@Sohorev Why is this needed?
Because AbstractServiceFactory for zend log it is comfortably But if I use PsrLoggerAdapter that I have to create log in factory style. It seems uncomfortable.
For example with zend log I have one line config for all my logs:
'abstract_factories' => [
Zend\Log\LoggerAbstractServiceFactory::class,
]
But with PsrLoggerAdapter i have a following ponderous config :
'factories' => [
'logger' => \My\Log\LoggerFactory::class,
'error-logger' => \MyLog\LoggerFactory::class,
'sql-logger' => \My\Log\LoggerFactory::class,
......
],
Additionally, in either case a following config exists (This can not be avoided):
'log' => [
'logger' => [
'writers' => [
.....
],
],
'error-logger' => [
'writers' => [
.....
],
],
'sql-logger' => [
'writers' => [
.....
],
..............
],
Because AbstractServiceFactory for zend log it is comfortably But if I use PsrLoggerAdapter that I have to create log in factory style. It seems uncomfortable.
Ah, now I understand. I was confused why a AbstractServiceFactory
should be needed for the PsrLoggerAdapter
.
You mean a ready to use factory for the PSR adapter.
Btw. you do not need this:
'abstract_factories' => [
Zend\Log\LoggerAbstractServiceFactory::class,
]
application.config.php:
'modules' => [
'Zend\Log',
]
You mean a ready to use factory for the PSR adapter.
yes
Use zend-log as module.
I have use zend expressive and zend PsrLoggerAdapter as my logger. But factory style for every logger uncomfortably. When i try to add following:
$configManager = new ConfigManager([
....
\Zend\Log\ConfigProvider::class,
.....
], 'data/config-cache.php');
it create Zend\Log\Logger objects but I am need for Zend\Log\PsrLoggerAdapter objects
can be closed in favor of https://github.com/zendframework/zend-log/pull/99
Please create AbstractServiceFactory for Zend\Log\PsrLoggerAdapter