Configuration for MongoDB Query Logging
Author: mshamaseenCreated Jun 17, 2026Updated Jun 18, 2026
Labelstracked-in-jira
- Laravel-mongodb Version: 5.7.1
- PHP Version: 8.4
- Database Driver & Version:
Description:
Laravel Debugbar and Telescope record MongoDB queries in Canonical Extended JSON. which is not supported by default by these packages and is impossible to copy-paste into a Mongo shell.
Expected behaviour
Devs should be able to configure the format they want to use.
Actual behaviour
MongoDB log in Canonical Extended JSON format
This is probably caused by https://github.com/mongodb/laravel-mongodb/blob/d83f1c4cb73cb4d935a3378d967af18cd61f8b8c/src/CommandSubscriber.php#L55
Source: mongodb/laravel-mongodb