arangodb-java-driver icon indicating copy to clipboard operation
arangodb-java-driver copied to clipboard

Easy way to show only query on debugger log

Open giovanniac opened this issue 4 years ago • 3 comments

I have a situation where I want to activate only the query debug logger while I set up the driver builder. The debug log output that I want to activate is shown in line 135 here:

https://github.com/arangodb/arangodb-java-driver/blob/71fb190ba316f3c618514633fd51e2101a95756e/src/main/java/com/arangodb/internal/velocystream/VstCommunicationSync.java

It would be interesting to have an easy way to access this option for future troubleshooting and to have a better and more transparent point of view of what query is being builded up while developing.

Thanks for the help!

giovanniac avatar Jul 03 '20 14:07 giovanniac

You can enable debug level for such logger adding the following to your logback.xml:

    <logger name="com.arangodb.internal.velocystream.VstCommunicationSync" level="debug"/>

Additionally you might want to filter the logged rows using Logback filters: http://logback.qos.ch/manual/filters.html

rashtao avatar Jul 03 '20 15:07 rashtao

Problems with this approach:

  1. The log is by class and not by function. If someone ever puts another log in this class, something that does not mean that it is the query will come out.

  2. when the driver proves to be "professional". Having a flag that turns a driver function on or off is much more professional than simply turning on a debug. You put in the driver's documentation that this parameter exists, it is quite different from what you put in that the way to use it is to turn on the debugging of an "unknown" class.

PauloFerreira25 avatar Jul 03 '20 19:07 PauloFerreira25

Thanks for sharing, we will consider the possibility to implement logging categories in future versions.

rashtao avatar Jul 13 '20 10:07 rashtao