Log4php
  1. Log4php
  2. LOG4PHP-62

Does not print warning if ini file is corrupt

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: Code
    • Labels:
      None

      Description

      Grmpf! There was a simple typo in the ini file and log4php did ... nothing! Not even tell me that there was an error or even where exactly! It took me quite some time to debug that. How I hate such software...

      I understand that a logging framework tries to be as non-disruptive as possible and we can argue about whether it should throw an exception just because the database server, it tries to log, to is suddenly (temporarily) unavailable but as parsing the ini file happens at the very first of most applications I'm totally in favour of throwing an exception here!

      Please find a patch attached. It will cause the output to look like:

      $ php testPDO.php

      Exception: LoggerConfiguratorIni: Error parsing testPDO.properties on line 7
      in /srv/home/james/workspace/log4php/src/main/php/configurators/LoggerConfiguratorIni.php on line 307

      bye,

      christian

      1. WarnIfIniHasErrors-Test.diff
        0.7 kB
        Christian Hammers
      2. WarnIfIniHasErrors.diff
        0.7 kB
        Christian Hammers

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Christian Hammers
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development