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

Using LoggerAppenderFile logging to the log file in one Apache session blocks every other Apache session that tries to write to the file until the original request has been processed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0
    • Code
    • None
    • MAMP, LAMP, WAMP

    Description

      Note: We probably have an older version of log4php than what's currently available.

      We were experiencing problems in our application where one session is waiting on another session. This effectively single threads our Apache requests for different clients. We narrowed this down to our use of log4php.

      The code below will open a file for writing but will not close it until the request has been handled:
      $logger = LoggerManager::getLogger('logger');
      $logger->debug($message);

      We added the following call and are no longer experiencing the file blocking since it looks like this call closes the file:
      LoggerManager::shutdown();

      Is this the expected behavior? Should the log file be kept open between usage?

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cwilliams Chris Williams
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: