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

LoggerAppenderRollingFile unable to rollover

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • None
    • 2.0.0
    • Code
    • None
    • Microsoft Windows XP
      PHP 5.2.8

    Description

      LoggerAppenderRollingFile can only rollover one time, after that the filename property will be empty. This is caused by the realpath() function being used, when the file it is used on, is currently not existing (because it has been renamed to <filename>.1).

      I created a small patch to resolve this issue

      Index: LoggerAppenderRollingFile.php
      ===================================================================
      — LoggerAppenderRollingFile.php (revision 759099)
      +++ LoggerAppenderRollingFile.php (working copy)
      @@ -149,9 +149,9 @@
      rename($file, $target);
      }

      • $this->setFile($fileName, false);
        unset($this->fp);
        $this->activateOptions();
        + $this->setFile($fileName, false);
        }

      function setFileName($fileName)

      Attachments

        Activity

          People

            Unassigned Unassigned
            denniskorbar Dennis Korbar
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: