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

[PROPOSAL] It would be nice to see Doctrine queries in Laravel Telescope #500

Open
rosamarsky opened this issue Sep 14, 2021 · 3 comments
Open

Comments

@rosamarsky
Copy link
Contributor

Expected behaviour

Queries are displaying on the Queries page

Actual behaviour

image

@eigan
Copy link
Member

eigan commented Sep 15, 2021

You might be able to build this by creating a logger.

See https://github.com/laravel-doctrine/orm/blob/9dc7790f86c2013fc43a733bde50efc0ec17881e/src/Loggers/LaravelDebugbarLogger.php for inspiration, and https://github.com/laravel/telescope/blob/4.x/src/Watchers/QueryWatcher.php for how to push to Telescope. Looks like Telescope::recordQuery is the way.

Register your logger in config/doctrine.php at the logger key (which should use the DOCTRINE_LOGGER environment variable.

@rosamarsky
Copy link
Contributor Author

You might be able to build this by creating a logger.

See https://github.com/laravel-doctrine/orm/blob/9dc7790f86c2013fc43a733bde50efc0ec17881e/src/Loggers/LaravelDebugbarLogger.php for inspiration, and https://github.com/laravel/telescope/blob/4.x/src/Watchers/QueryWatcher.php for how to push to Telescope. Looks like Telescope::recordQuery is the way.

Register your logger in config/doctrine.php at the logger key (which should use the DOCTRINE_LOGGER environment variable.

Thanks, I think it will help me a lot :)

@eigan
Copy link
Member

eigan commented Sep 22, 2021

@rosamarsky Relevant PR opened recently: #501. This might make the telescope QueryWatcher work as expected.

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

No branches or pull requests

2 participants