Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

The Log module is not ServiceManager friendly #2568

Closed
zfbot opened this Issue · 8 comments

5 participants

@zfbot
Owner

Jira Information

Original Issue: ZF2-535
Issue Type: Improvement
Reporter: texdc
Created: 09/09/12
Assignee: weierophinney
Components: Zend\Log Zend\ServiceManager

Description

Using a configuration array to wire up a global logger is currently obtuse. Writers construct signatures vary too much to be practical. Here's what I want to do in my autoload/global.php:

array(
    'logger' => array(
        'writers' => array(
            'Stream' => array(
                'streamOrUrl' => 'log/application.log',
            ),
        ),
    ),
);

Now, I can write a custom Factory just for that Writer. But, as soon as I try to make it generic for any writer, I run into signature hell. I haven't even begun to try to config filters or formatters.

See: http://logging.apache.org/log4php/docs/configuration.html

@zfbot
Owner

(Originally posted by: texdc on 09/09/12)

Also, regarding the tutorial project: Who starts any project without logging? Only amateurs.

@zfbot
Owner

(Originally posted by: b-durand on 09/11/12)

What is your problem exactly? Can you add the actual config to compare with the expected config?

I don't see something different in log4php, if you take two appenders like File and PDO: you need to define dsn for PDO, and file for File.

@zfbot
Owner

(Originally posted by: texdc on 09/17/12)

Where is an example of the current recommended service manager config for a global logger with multiple writers? If you can provide a clean example, then this issue can be closed.

@zfbot
Owner

This issue was ported from the ZF2 Jira Issue Tracker at
http://framework.zend.com/issues/browse/ZF2-535

Known GitHub users mentioned in the original message or comment:
@texdc, @weierophinney, @b-durand

@stefankleff

As far as I understand your problem is, that you cannot use an array (=config file) to setup the loggers. This was possible in ZF1 but it was marked as todo in ZF2. I've tried to provide that functionality in #2725

@Freeaqingme
Collaborator

@stefankleff Given that #2725 was merged, does that mean this issue can be closed?

@stefankleff

I think so. I'm not the creator of this issue, but I covered the mentioned use case in #2725.

@texdc
@Maks3w Maks3w closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.