[ 
https://issues.apache.org/jira/browse/LOG4PHP-110?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ivan Habunek reopened LOG4PHP-110:
----------------------------------


Not to sound ungrateful, but I have several issues with this patch.

The first thing I noticed is that log4php test suite crashes with a fatal error 
if MongoDB extension is not loaded. This should be handled in a way that the 
tests are skipped if required extensions are not loaded (see 
LoggerAppenderPDOTest.php).

Second, there are several issues with the layout class LoggerMongoDBBsonLayout. 
* It does not follow naming conventions - it should be called LoggerLayoutBson.
* The name suggests it formats data in BSON format, but it doesnt; it returns 
ArrayObject objects. Maybe it should be called LogerLayoutArray or similar. 
BTW, why use ArrayObject instead of the regular PHP array?

This raises an interesting issue. The above layout, as it is now, is not 
compatible with other appenders because it doesn't return a string 
representation of an event, like all other layouts do. Should this be allowed 
at all? Perhaps a better solution would be for LoggerAppenderMongoDB not to use 
a layout, but to convert the Logging event into an array internally.

Third, the tests do not follow conventions (one test class pre tested class). 
This refers to LoggerAppenderMongoDBLayoutTest.php which should be integrated 
into the appender test class or the layout test class.

To conclude, I think this needs a little work before being included in a stable 
release. I'll try to do a full code review when I get a little free time. I 
think we can fix this before v2.1 release.

> mongo database appender for log4php
> -----------------------------------
>
>                 Key: LOG4PHP-110
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-110
>             Project: Log4php
>          Issue Type: New Feature
>          Components: Code, Documentation, Tests
>    Affects Versions: 2.0
>         Environment: PHP
>            Reporter: Vladimir Gorej
>            Assignee: Christian Grobmeier
>             Fix For: 2.1
>
>         Attachments: src.tgz, throwable.path
>
>
> mongo database appender for log4php with unit test coverage

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to