1

We have a legacy application that is being transitioned from MySQL v5.6 to MariaDB 10.8. This application uses a home grown logger ( enough said ). However, when SQL commands like preparedStatement.executeQuery() are run, any SQLException that is generated is being mirrored to the console ( I assume via stderr ). How can I stop this extra noise. The exception is trapped and handled, but the extra console noise is annoying.

danblack
  • 12,130
  • 2
  • 22
  • 41
garneke
  • 35
  • 6

1 Answers1

2

MariaDB java connector since 3.0 is using Slf4j logger if present, falling back on console if not.

This can be disabled setting System property "mariadb.logging.disable" to true. example :

java -Dmariadb.logging.disable=true ...
Diego Dupin
  • 1,106
  • 8
  • 9
  • This option ended up being the solution for me, however, since the code in question was running within an enterprise application server and this system property is only interrogated once by mariadb in a static init() block, I could not set it programmatically it had to be done in the jvm-options. Probably the same reasons I could not get any of the slf4j configuration options to work either. – garneke Sep 09 '22 at 18:02