Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.2.0
    • Component/s: Code
    • Labels:
      None

      Description

      The current configuration system uses 3 separate objects to configure log4php - one for each configuration format XML, properties and PHP. This often caused inconsistencies in the way log4php is configured - the equivalent configuration would not produce the same results.

      The idea is to create a singe Configurator object which will only take configuration as a PHP array. Then create several Adapter objects (one for each configuration format) which will translate the configuration from that format to a PHP array understood by the Configurator. This would make the Configurator the single class which configures log4php.

      The second goal of this action is to improve error reporting. Any configuration which cannot be parsed, or any invalid value in configuration should produce a PHP warning informing the user what's wrong.

      Thirdly, we should insure that the configurator does not throw any exceptions. Any errors should only result in a warning message so it doesn't break apps just because it cannot log.

      Lastly, we can standardize and document the PHP configuration format which exists already, but is not documented.

      1. log4php.patch
        26 kB
        Florian Semm

        Issue Links

          Activity

          Hide
          Ivan Habunek added a comment -

          I believe the new configurator is stable enough to be released. Resolving issue.

          Show
          Ivan Habunek added a comment - I believe the new configurator is stable enough to be released. Resolving issue.
          Hide
          Ivan Habunek added a comment -

          This patch is really very good. Thanks for the work.

          I like the idea of having the test/resources/config/ dir for all configuration files. I moved others there as well and renamed them to something more sensible than config1, config2...

          I have done some very minor changes, like using dirname(_FILE) in place of __DIR_ to keep compatibility with PHP 5.2.x.

          Show
          Ivan Habunek added a comment - This patch is really very good. Thanks for the work. I like the idea of having the test/resources/config/ dir for all configuration files. I moved others there as well and renamed them to something more sensible than config1, config2... I have done some very minor changes, like using dirname(_ FILE ) in place of __DIR _ to keep compatibility with PHP 5.2.x.
          Hide
          Florian Semm added a comment - - edited

          some additional tests for

          • LoggerConfigurator
          • LoggerAppenderPool
          Show
          Florian Semm added a comment - - edited some additional tests for LoggerConfigurator LoggerAppenderPool
          Hide
          Ivan Habunek added a comment -

          The new code has been merged with trunk. It is pretty stable and all tests pass.

          Additional tests have to be written to improve code coverage.

          Show
          Ivan Habunek added a comment - The new code has been merged with trunk. It is pretty stable and all tests pass. Additional tests have to be written to improve code coverage.
          Hide
          Ivan Habunek added a comment -

          The work is already well under way at an experimental branch:
          https://svn.apache.org/repos/asf/logging/log4php/branches/experimental/config-adapters

          Show
          Ivan Habunek added a comment - The work is already well under way at an experimental branch: https://svn.apache.org/repos/asf/logging/log4php/branches/experimental/config-adapters

            People

            • Assignee:
              Ivan Habunek
              Reporter:
              Ivan Habunek
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development