Re: How to enable logging in mysql-connector-java-5.1.36
Hi Subramanian,
By using the provided standard logger implementation (com.mysql.jdbc.log.StandardLogger) everything gets logged into the STDERR channel. So, unless you redirect STDERR to a log4j logger, you won't get any messages in there.
You have other alternatives though. You can implement your own log4j bridge by implementing the interface com.mysql.jdbc.log.Log and refer to the resulting class in the connection property 'logger'. Or, you can use the third party library SLF4J, integrate it with log4j or other logging framework you like, and set the connection property 'logger' to 'com.mysql.jdbc.log.Slf4JLogger'.
Hope this helps.
Subject
Written By
Posted
September 18, 2015 07:01AM
Re: How to enable logging in mysql-connector-java-5.1.36
September 22, 2015 05:39AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.