Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Need way to specify in the logger configuration the factory for the own writer #4455

Merged
merged 6 commits into from
Mar 10, 2014

Conversation

weierophinney
Copy link
Member

I want add to a logger my own writer who created by factory and I cann`t find any way for do this.

Here is the link to the stackoverflow, where I asked whether it is possible do that http://stackoverflow.com/questions/16414926/is-there-a-way-to-add-a-log-writer-factory-into-the-logger-configuration

@weierophinney
Copy link
Member

You're right; it's not possible yet. The logger service factories we have currently always instantiate a logger instance directly, and do not inject the writer or processor plugins, which means you can only use defaults currently.

Scheduling for 2.3.0, as we will need to add the writer and processor plugin managers to the service manager first, and then alter the existing factories to use them. As such, we will have new functionality, which is reserved for new minor versions.

@bladeofsteel
Copy link
Contributor Author

I understood, thanks for the clarification

@DragonBe
Copy link
Contributor

Is this still something we need to keep open?

weierophinney added a commit to weierophinney/zendframework that referenced this pull request Mar 5, 2014
- Allows passing the WriterPluginManager to the Logger constructor.
- Adaptes the LoggerAbstractServiceFactory to inject the
  WriterPluginManager into the configuration prior to instantiating the
  logger.
weierophinney added a commit to weierophinney/zendframework that referenced this pull request Mar 5, 2014
- Allows passing the ProcessorPluginManager to the Logger constructor
- Adaptes the LoggerAbstractServiceFactory to inject the
  ProcessorPluginManager into the configuration prior to instantiating
  the logger.
weierophinney added a commit to weierophinney/zendframework that referenced this pull request Mar 5, 2014
- LogWriterManager and LogProcessorManager services.
- Wired into base service manager configuration, as well as
  ModuleManager feature provider system.
weierophinney added a commit to weierophinney/zendframework that referenced this pull request Mar 5, 2014
- Use LogWriterManager and LogProcessorManager services instead.
- Added group annotations to tests
weierophinney added a commit to weierophinney/zendframework that referenced this pull request Mar 5, 2014
- trailing whitespace
weierophinney added a commit to weierophinney/zendframework that referenced this pull request Mar 5, 2014
@@ -140,6 +141,20 @@ public function __construct($options = null)
throw new Exception\InvalidArgumentException('Options must be an array or an object implementing \Traversable ');
}

// Inject writer plugin manager, if available
if (isset($options['writer_plugin_manager'])
&& $options['writer_plugin_manager'] instanceof AbstractPluginManager
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why AbstractPluginManager and not just ServiceLocatorInterface?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how we've typically written these, as it allows you to assume in your factories that you need to get the parent service locator instance if you need to get at app-level services.

@Ocramius
Copy link
Member

This PR also requires a rebase

- Allows passing the WriterPluginManager to the Logger constructor.
- Adaptes the LoggerAbstractServiceFactory to inject the
  WriterPluginManager into the configuration prior to instantiating the
  logger.
- Allows passing the ProcessorPluginManager to the Logger constructor
- Adaptes the LoggerAbstractServiceFactory to inject the
  ProcessorPluginManager into the configuration prior to instantiating
  the logger.
- LogWriterManager and LogProcessorManager services.
- Wired into base service manager configuration, as well as
  ModuleManager feature provider system.
- Use LogWriterManager and LogProcessorManager services instead.
- Added group annotations to tests
- trailing whitespace
Ocramius added a commit that referenced this pull request Mar 10, 2014
@Ocramius Ocramius merged commit ce72b7e into zendframework:develop Mar 10, 2014
@Ocramius Ocramius self-assigned this Mar 10, 2014
@weierophinney weierophinney deleted the feature/4455 branch March 10, 2014 20:08
weierophinney added a commit to zendframework/zend-modulemanager that referenced this pull request May 15, 2015
…steners

- LogWriterManager and LogProcessorManager services.
- Wired into base service manager configuration, as well as
  ModuleManager feature provider system.
gianarb pushed a commit to zendframework/zend-modulemanager that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-log that referenced this pull request May 15, 2015
…to logger

- Allows passing the WriterPluginManager to the Logger constructor.
- Adaptes the LoggerAbstractServiceFactory to inject the
  WriterPluginManager into the configuration prior to instantiating the
  logger.
weierophinney added a commit to zendframework/zend-log that referenced this pull request May 15, 2015
…er to logger

- Allows passing the ProcessorPluginManager to the Logger constructor
- Adaptes the LoggerAbstractServiceFactory to inject the
  ProcessorPluginManager into the configuration prior to instantiating
  the logger.
weierophinney added a commit to zendframework/zend-log that referenced this pull request May 15, 2015
… reflect MVC

- Use LogWriterManager and LogProcessorManager services instead.
- Added group annotations to tests
weierophinney added a commit to zendframework/zend-log that referenced this pull request May 15, 2015
gianarb pushed a commit to zendframework/zend-log that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants