Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easy way to show only query on debugger log #350

Open
giovanniac opened this issue Jul 3, 2020 · 3 comments
Open

Easy way to show only query on debugger log #350

giovanniac opened this issue Jul 3, 2020 · 3 comments

Comments

@giovanniac
Copy link

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!

@rashtao
Copy link
Collaborator

rashtao commented Jul 3, 2020

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

@PauloFerreira25
Copy link
Contributor

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.

@rashtao
Copy link
Collaborator

rashtao commented Jul 13, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants