You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4php-dev@logging.apache.org by "Ivan Habunek (Resolved) (JIRA)" <ji...@apache.org> on 2011/09/30 08:28:50 UTC

[jira] [Resolved] (LOG4PHP-116) A rewrite of LoggerConfiguratorXML

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

Ivan Habunek resolved LOG4PHP-116.
----------------------------------

       Resolution: Not A Problem
    Fix Version/s:     (was: 2.2)
         Assignee: Ivan Habunek

This issue has been superseeded by LOG4PHP-152 which has an even wider scope of rewriting the whole configurator subpackage.
                
> A rewrite of LoggerConfiguratorXML
> ----------------------------------
>
>                 Key: LOG4PHP-116
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-116
>             Project: Log4php
>          Issue Type: Improvement
>          Components: Code
>    Affects Versions: 2.0, 2.1
>            Reporter: Ivan Habunek
>            Assignee: Ivan Habunek
>         Attachments: LoggerConfiguratorXML.rewrite.patch
>
>
> As discussed on the mailing list, it was decided that the LoggerConfiguratorXML would benefit from a rewrite. This is a full rewrite of the class using PHP's SimpleXML extension for parsing XML. 
> (http://www.php.net/manual/en/book.simplexml.php)
> The new implementation gives the following benefits compared to the current implementation:
> * The code is cleaner and much more readable.
> * The code executes in a more linear fashion, instead of an "infinite loop"
> * The elements in the XML configuration are not parsed in the order they are written, therefore the order of elements is no longer important. Well, this is not entirely true, the order of parameters might be important for for some appenders or other components, but this is not a Configurator issue and has to be solved in the said components.
> * Implemented internal error logging and debugging. Makes it easier for end user to diagnose problems with the configuration.
> LoggerLog class was reinstated to facilitate internal logging. It is very simple, it has 3 logging methods: debug(), error() and warn(). These methods use the PHP function trigger_error for logging (with appropreate error types: E_USER_NOTICE for debug, E_USER_WARNING for warn and E_USER_ERROR for error messages). Error and warning level messages are enabled by default. Debug level are disabled by default, but can be enabled by:
> * calling LoggerLog::setInternalDebugging(true)
> * specifying debug="true" in root element of XML config file
> * setting the environment variable log4php.debug=true
> Additionally, the following changes were made to complement the above changes:
> * LoggerOptionConverter::getSystemProperty was modified to check getenv($key) as well as $_ENV[$key], because $_ENV global array is sometimes not populated depending on the settings in php.ini (see variables_order directive in http://php.net/manual/en/ini.core.php).
> * Implemented the __toString method in LoggerLevel. This allows for easier logging of levels, e.g. debug("Setting level to $level") where $level is an instance of LoggerLevel.
> Note that the debug mode is quite verbose, I tried to show the order in which settings are parsed, and state if any setting was ignored and why.
> Please try out and state your opinion. :)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira