-
-
Notifications
You must be signed in to change notification settings - Fork 621
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
Add-on for easily turning on/off or tail-ing the db query log #5689
Comments
@apotek Thanks for the suggestion. Might be worth posting the command here, or sharing a gist to it so people can have a play and give feedback. |
Hi @tyler36 and thank you for your reply. I just posted a merge request which should demonstrate the approach. I don't think the addon approach feels right to me since the point here is not to add an additional service but to add a command to a service that is already supported. But please correct me if I am wrong. I can in the meantime attempt to expand this script to include pgsql support as well (or just write another for that). But this should provide a starting point. |
You can find the template here: https://github.com/ddev/ddev-addon-template EG. https://github.com/tyler36/ddev-vscode-devcontainer is a simple addon that adds a "code" command. |
I think that is a great idea and it helps me often when debugging. I've made this command some years ago: https://gist.github.com/jonaseberle/28a675d034dfa1dbaf8e586184fd1d77 but I've not come around to upstream it as a DDEV add-on. Please feel free to take from it what you find useful. I am happy to install the add-on from you then! :) |
Hi @tyler36 and @jonaseberle ! Thank you for your suggestions. I have created a rough draft for this as an add-on. https://github.com/ChromaticHQ/ddev-dblog @jonaseberle I like a lot of the ideas in your script and may want to incorporate some of them while keeping the command light weight. |
@tyler36 I have put up test-passing beta at https://github.com/ChromaticHQ/ddev-dblog and posted a feature request for postgres support here: ChromaticHQ/ddev-dblog#1 @jonaseberle I have added a feature request to maybe implement some of your gist-ideas into the UX as the add-on matures. Thank you again for your suggestions: ChromaticHQ/ddev-dblog#2 |
Thanks, that works well. I think we can close here and use |
Yay, thanks! |
Is there an existing issue for this?
Is your feature request related to a problem?
When using ddev with a framework with a database abstraction layer, it can be finicky to set up being able to see the actual database queries generated by the application.
Describe your solution
A custom ddev command that allows a user to very very easily turn on or off query logging and optionally to tail that log.
Due to the noisy nature of the db log output, it would be best to exclude it from the general
ddev logs
output.Describe alternatives
I considered adding configuration to the db container that would send all queries to the ddev logs. But I realized that would create a lot of noise, would slow down the application, and would make it difficult to toggle on and off. Looking at the db logs is generally something only necessary to do occasionally.
Additional context
I have written a command as described above and am using it successfully. I am posting this issue to see whether it would be considered generally worthwhile enough for it to be contributed to the ddev project as an included command.
The text was updated successfully, but these errors were encountered: