MariaDB JDBC Client Logging

2019-08-07 10:46发布

Is there any way to log queries in java using the MariaDB jdbc driver?

With the MySQL driver, I am using

profileSQL=true
logger=com.mysql.jdbc.log.Slf4JLogger

to log queries on dev machines (makes debugging a lot easier).

I realize things like log4jdbc exist - do I need to use a library like that or does the mariadb driver have something built in?

2条回答
该账号已被封号
2楼-- · 2019-08-07 11:10
兄弟一词,经得起流年.
3楼-- · 2019-08-07 11:29

Currently there is no way to log sql queries from mariadb java client.

You can see this link: https://mariadb.com/kb/en/mariadb/client-libraries/mariadb-java-client/about-the-mariadb-java-client/

However an alternative is you can use dumpQueriesOnException if that can help.

查看更多
登录 后发表回答