Uploaded image for project: 'Log4php'
  1. Log4php
  2. LOG4PHP-19

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0
    • None
    • None
    • 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;
        -----------------------------------------------------------------------------------

      Attachments

        Activity

          People

            Unassigned Unassigned
            whitestar Yomei Komiya
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: