MariaDB JDBC 客户端日志记录

2022-01-15 00:00:00 logging mariadb jdbc java

有没有办法使用 MariaDB jdbc 驱动程序在 java 中记录查询?

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

我正在使用 MySQL 驱动程序

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).

我意识到存在 log4jdbc 之类的东西 - 我需要使用这样的库吗?mariadb驱动有内置的吗?

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

推荐答案

从 1.5.0 开始,支持日志.

Since 1.5.0, log is supported.

相关文章