Hi !

We get an uncaught exception from Log4J which causes our application to crash.

More specifically, we are using Log4J 1.2.13 with a JDBC appender which relies on the MySQL Connector 3.1.13 and when the application invoke the Logger.debug() method the following exception is not caught by the Log4J framework.

This exception is throwed by the connector because the MySQL server is unreachable.

INFO | jvm 1 | 2008/05/21 13:44:24 | java.net.SocketException: java.net.ConnectException: Connection refused: connect INFO | jvm 1 | 2008/05/21 13:44:24 | at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156) INFO | jvm 1 | 2008/05/21 13:44:24 | at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:284) INFO | jvm 1 | 2008/05/21 13:44:24 | at com.mysql.jdbc.Connection.createNewIO(Connection.java:2565) INFO | jvm 1 | 2008/05/21 13:44:24 | at com.mysql.jdbc.Connection.<init>(Connection.java:1485) INFO | jvm 1 | 2008/05/21 13:44:24 | at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) INFO | jvm 1 | 2008/05/21 13:44:24 | at java.sql.DriverManager.getConnection(Unknown Source) INFO | jvm 1 | 2008/05/21 13:44:24 | at java.sql.DriverManager.getConnection(Unknown Source) INFO | jvm 1 | 2008/05/21 13:44:24 | at org.apache.log4j.jdbcplus.JDBCDefaultConnectionHandler.getConnection(JDBCDefaultConnectionHandler.java:77) INFO | jvm 1 | 2008/05/21 13:44:24 | at org.apache.log4j.jdbcplus.JDBCDefaultConnectionHandler.getConnection(JDBCDefaultConnectionHandler.java:53) INFO | jvm 1 | 2008/05/21 13:44:24 | at org.apache.log4j.jdbcplus.JDBCLogger.prepareConnection(JDBCLogger.java:489) INFO | jvm 1 | 2008/05/21 13:44:24 | at org.apache.log4j.jdbcplus.JDBCLogger.append(JDBCLogger.java:555) INFO | jvm 1 | 2008/05/21 13:44:24 | at org.apache.log4j.jdbcplus.JDBCAppender.flush_buffer(JDBCAppender.java:887) INFO | jvm 1 | 2008/05/21 13:44:24 | at org.apache.log4j.jdbcplus.JDBCAppender.append(JDBCAppender.java:867) INFO | jvm 1 | 2008/05/21 13:44:24 | at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230) INFO | jvm 1 | 2008/05/21 13:44:24 | at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:65) INFO | jvm 1 | 2008/05/21 13:44:24 | at org.apache.log4j.Category.callAppenders(Category.java:203) INFO | jvm 1 | 2008/05/21 13:44:24 | at org.apache.log4j.Category.forcedLog(Category.java:388) INFO | jvm 1 | 2008/05/21 13:44:24 | at org.apache.log4j.Category.debug(Category.java:257)

We would like our application to simply ignore this appender in such case.

Is there a way to do this without changing our application code base ?

Is there any Log4J configuration parameter which could enable Log4J appender exception handling ?

Thanks a lot for your help !

Best regards,

--



*Rémy Bélanger*

Senior Software Designer / Développeur de logiciels sénior

CISSP, SCJ2P

____________________________________________

Okiok Tel. : (450) 681.1681 http://www.okiok.com <http://www.okiok.com/>
Enterprise and e-business security solutions /

Solutions de sécurité d'entreprise et d'affaires électroniques



This e-mail message (including attachments, if any) is intended for the use
of the individual or entity to which it is addressed and may contain
information that is privileged, proprietary, confidential and exempt from
disclosure.  If you are not the intended recipient, you are notified that
any dissemination, distribution or copying of this communication is strictly
prohibited.  If you have received this communication in error, please notify
the sender and erase this e-mail message immediately.



Le présent message électronique (y compris les pièces qui y sont annexées,
le cas échéant) s'adresse au destinataire indiqué et peut contenir des
renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le
destinataire de ce document, nous vous signalons qu'il est strictement
interdit de le diffuser, de le distribuer ou de le reproduire. Si ce message
vous a été transmis par erreur, veuillez en informer l'expéditeur et le
supprimer immédiatement.






--



*Rémy Bélanger*

Senior Software Designer / Développeur de logiciels sénior

CISSP, SCJ2P

____________________________________________

Okiok Tel. : (450) 681.1681 http://www.okiok.com <http://www.okiok.com/>
Enterprise and e-business security solutions /

Solutions de sécurité d'entreprise et d'affaires électroniques



This e-mail message (including attachments, if any) is intended for the use
of the individual or entity to which it is addressed and may contain
information that is privileged, proprietary, confidential and exempt from
disclosure.  If you are not the intended recipient, you are notified that
any dissemination, distribution or copying of this communication is strictly
prohibited.  If you have received this communication in error, please notify
the sender and erase this e-mail message immediately.



Le présent message électronique (y compris les pièces qui y sont annexées,
le cas échéant) s'adresse au destinataire indiqué et peut contenir des
renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le
destinataire de ce document, nous vous signalons qu'il est strictement
interdit de le diffuser, de le distribuer ou de le reproduire. Si ce message
vous a été transmis par erreur, veuillez en informer l'expéditeur et le
supprimer immédiatement.




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to