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

LoggerAppenderPDO loses connection in long running scripts

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.3.0
    • Code
    • None

    Description

      If a script doesn't log anything for a time longer than the database server keeps an idle connection open the LoggerAppenderPDO throws an exception.

      I have scripts running much longer than the default wait_timeout value defined in our MySQL server. This eventually causes the PDO appender to throw an exception (especially when running with a threshold of ERROR or above, which ideally hardly occurs) and renders it unusable for my application.

      As a solution the PDO appender could either allow to define an initial statement that is executed right after the connection is opened. That could be used to increase the timeout time to whatever is needed. Or the appender detects that the connection has gone away, tries to re-establish it silently and only throws an exception if that attempt fails.

      Attachments

        Activity

          People

            juice Ivan Habunek
            vkueffel Volker Kueffel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: