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.