Log4php
  1. Log4php
  2. LOG4PHP-19

Logger location info is invalid in log outputs of Logger's subclasses.

    Details

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

      log4php r692607,
      PHP 5.2.4-2ubuntu5.3 with Suhosin-Patch 0.9.6.2,
      Ubuntu 8.04

      Description

      When I log it by the original logger subclass of Logger, its location information (%F, %L, %M) is not appropriate.
      It seems that parent class identification of logger class failed.

      patch as follows.
      -----------------------------------------------------------------------------------
      diff -urN log4php/spi/LoggerLoggingEvent.php log4php.new/spi/LoggerLoggingEvent.php
      — log4php/spi/LoggerLoggingEvent.php
      +++ log4php.new/spi/LoggerLoggingEvent.php
      @@ -184,7 +184,8 @@
      while ($hop !== null) {
      $className = @strtolower($hop['class']);
      if ( !empty($className) and ($className == 'logger' or $className == 'loggercategory' or

      • get_parent_class($className) == 'logger') or get_parent_class($className) == 'loggercategory') {
        + @strtolower(get_parent_class($className)) == 'logger' or
        + @strtolower(get_parent_class($className)) == 'loggercategory')) {
        $locationInfo['line'] = $hop['line'];
        $locationInfo['file'] = $hop['file'];
        break;
        -----------------------------------------------------------------------------------

        Activity

        Hide
        Yomei Komiya added a comment -

        This patch was committed at r699322.

        Show
        Yomei Komiya added a comment - This patch was committed at r699322.

          People

          • Assignee:
            Unassigned
            Reporter:
            Yomei Komiya
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development