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

Log sql variables #3314

Merged
merged 3 commits into from Aug 7, 2018
Merged

Log sql variables #3314

merged 3 commits into from Aug 7, 2018

Conversation

mnaiman
Copy link
Contributor

@mnaiman mnaiman commented Jul 6, 2018

All SQL statements are logged to file when Profiling is set.
Profiling is so verbose in other parts, that in SQL worth to have it.
For chasing bugs or understanding whats happening is valuable.

@duplicatibot
Copy link

This pull request has been mentioned on Duplicati. There might be relevant details there:

https://forum.duplicati.com/t/unique-constraint-failed-with-sia-support-request-2-0-3-6/3515/13

@JonMikelV
Copy link
Contributor

Am I reading that correctly that it will include the SQL parameters in the logs as well? I've kind of been wanting that for a while, but am a bit worried about potential security / auth. leakage in some calls...

@kenkendk
Copy link
Member

kenkendk commented Aug 2, 2018

Yes, the logging will include the SQL parameters. However, the local database (which is where the logging code is active) only contains file+block hashes and filenames. Since the filenames are present on the machine, I do not see any security issues with adding this logging.

But there is a performance issue here, as the string building is done for each block lookup, even if the user has not activated logging. Due to the way the logging system works, the handler does not know if the the message is going to be used or not.

If we include this, we should perhaps add an extra commandline option that enables logging of even the performance critical parts. This would also improve performance overall, becase we would not be calling the log system for messages that we do not want anyway.

@kenkendk
Copy link
Member

kenkendk commented Aug 7, 2018

I have added a switch to enable detailed database logging (--profile-all-database-queries), and will merge this PR later today.

@kenkendk kenkendk merged commit 64201ae into duplicati:master Aug 7, 2018
@mnaiman mnaiman deleted the log_sql_variables branch September 4, 2018 20:40
@duplicatibot
Copy link

This pull request has been mentioned on Duplicati. There might be relevant details there:

https://forum.duplicati.com/t/what-does-it-mean-to-report-a-duplicate-path/1997/18

@duplicatibot
Copy link

This pull request has been mentioned on Duplicati. There might be relevant details there:

https://forum.duplicati.com/t/database-rebuild/13884/3

@duplicatibot
Copy link

This pull request has been mentioned on Duplicati. There might be relevant details there:

https://forum.duplicati.com/t/test-command-dont-work-with-version/15362/3

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

Successfully merging this pull request may close these issues.

None yet

4 participants