You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4php-dev@logging.apache.org by "Volker Kueffel (JIRA)" <ji...@apache.org> on 2011/01/12 23:22:45 UTC

[jira] Created: (LOG4PHP-134) LoggerAppenderPDO loses connection in long running scripts

LoggerAppenderPDO loses connection in long running scripts
----------------------------------------------------------

                 Key: LOG4PHP-134
                 URL: https://issues.apache.org/jira/browse/LOG4PHP-134
             Project: Log4php
          Issue Type: Bug
          Components: Code
    Affects Versions: 2.0
            Reporter: Volker Kueffel


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.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] [Closed] (LOG4PHP-134) LoggerAppenderPDO loses connection in long running scripts

Posted by "Ivan Habunek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4PHP-134?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan Habunek closed LOG4PHP-134.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.3.0
         Assignee: Ivan Habunek

This has been solved for some time. Forgot to close the issue apparently.

The appender will attempt to reconnect up to 3 times if logging fails. This should fix the problem with long running scripts.
                
> LoggerAppenderPDO loses connection in long running scripts
> ----------------------------------------------------------
>
>                 Key: LOG4PHP-134
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-134
>             Project: Log4php
>          Issue Type: Bug
>          Components: Code
>    Affects Versions: 2.0.0
>            Reporter: Volker Kueffel
>            Assignee: Ivan Habunek
>             Fix For: 2.3.0
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira