elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
69.62k stars 24.63k forks source link

JDBC driver logging improvements #41911

Closed ppf2 closed 6 months ago

ppf2 commented 5 years ago

6.7.0

The debug=true flag for the JDBC driver writes out all the java.sql calls and can be very verbose.

Here are a few suggestions on logging improvements:

  1. Would be nice to have different logging levels (not just debug) and allow the developers to turn up logging to specific levels
  2. Currently, the debug logging writes things like Connection, Statement, Resultset calls. For the Connection entry, it doesn't provide details on what Elasticsearch URL it is connecting to, and does not print out the list of connection properties used . (e.g., keystore/truststore paths, authenticated user, etc..).
2019-05-07/11:11:24.175 - Connection#createStatement() returned org.elasticsearch.xpack.sql.jdbc.JdbcStatement@3dd4520b

It will be helpful to write out the list of properties used as well as connection info.

  1. With debug=true, it does write out Statement close messages when Statement.close() is called.
2019-05-07/11:32:21.856 - ResultSet#next() returned false
2019-05-07/11:32:21.856 - Statement#close() returned null

But it doesn't appear to write out messages connection closing messages even though Connection.close() is also called from the code.

elasticmachine commented 5 years ago

Pinging @elastic/es-search

elasticsearchmachine commented 8 months ago

Pinging @elastic/es-analytical-engine (Team:Analytics)

wchaparro commented 6 months ago

Superceded by ES|QL