|
| 1 | +--- |
| 2 | +hide: |
| 3 | + - navigation |
| 4 | +--- |
| 5 | +!!! warning |
| 6 | + |
| 7 | + Debugbar can slow the application down (because it has to gather and render data). So when experiencing slowness, try disabling some of the collectors. |
| 8 | + |
| 9 | +## Collectors |
| 10 | + |
| 11 | +This package includes some custom collectors: |
| 12 | + |
| 13 | +- QueryCollector: Show all queries, including binding + timing |
| 14 | +- RouteCollector: Show information about the current Route. |
| 15 | +- ViewCollector: Show the currently loaded views. (Optionally: display the shared data) |
| 16 | +- EventsCollector: Show all events |
| 17 | +- LaravelCollector: Show the Laravel version and Environment. (disabled by default) |
| 18 | +- SymfonyRequestCollector: replaces the RequestCollector with more information about the request/response |
| 19 | +- LogsCollector: Show the latest log entries from the storage logs. (disabled by default) |
| 20 | +- FilesCollector: Show the files that are included/required by PHP. (disabled by default) |
| 21 | +- ConfigCollector: Display the values from the config files. (disabled by default) |
| 22 | +- CacheCollector: Display all cache events. (disabled by default) |
| 23 | + |
| 24 | +Bootstraps the following collectors for Laravel: |
| 25 | +- LogCollector: Show all Log messages |
| 26 | +- SymfonyMailCollector for Mail |
| 27 | + |
| 28 | +And the default collectors: |
| 29 | +- PhpInfoCollector |
| 30 | +- MessagesCollector |
| 31 | +- TimeDataCollector (With Booting and Application timing) |
| 32 | +- MemoryCollector |
| 33 | +- ExceptionsCollector |
| 34 | + |
| 35 | + |
| 36 | +To enable or disable any of the collectors, set the configuration to `true` or `false`. Some collector have additional options in the configuration: |
| 37 | + |
| 38 | + |
| 39 | +```php |
| 40 | + |
| 41 | + /* |
| 42 | + |-------------------------------------------------------------------------- |
| 43 | + | DataCollectors |
| 44 | + |-------------------------------------------------------------------------- |
| 45 | + | |
| 46 | + | Enable/disable DataCollectors |
| 47 | + | |
| 48 | + */ |
| 49 | + |
| 50 | + 'collectors' => [ |
| 51 | + 'phpinfo' => true, // Php version |
| 52 | + 'messages' => true, // Messages |
| 53 | + 'time' => true, // Time Datalogger |
| 54 | + 'memory' => true, // Memory usage |
| 55 | + 'exceptions' => true, // Exception displayer |
| 56 | + 'log' => true, // Logs from Monolog (merged in messages if enabled) |
| 57 | + 'db' => true, // Show database (PDO) queries and bindings |
| 58 | + 'views' => true, // Views with their data |
| 59 | + 'route' => true, // Current route information |
| 60 | + 'auth' => false, // Display Laravel authentication status |
| 61 | + 'gate' => false, // Display Laravel Gate checks |
| 62 | + 'session' => true, // Display session data |
| 63 | + 'symfony_request' => true, // Only one can be enabled.. |
| 64 | + 'mail' => false, // Catch mail messages |
| 65 | + 'laravel' => false, // Laravel version and environment |
| 66 | + 'events' => false, // All events fired |
| 67 | + 'default_request' => false, // Regular or special Symfony request logger |
| 68 | + 'logs' => false, // Add the latest log messages |
| 69 | + 'files' => false, // Show the included files |
| 70 | + 'config' => false, // Display config settings |
| 71 | + 'cache' => false, // Display cache events |
| 72 | + 'models' => false, // Display models |
| 73 | + 'livewire' => true, // Display Livewire (when available) |
| 74 | + 'jobs' => false, // Display dispatched jobs |
| 75 | + 'pennant' => false, // Display Pennant feature flags |
| 76 | + ], |
| 77 | + |
| 78 | + /* |
| 79 | + |-------------------------------------------------------------------------- |
| 80 | + | Extra options |
| 81 | + |-------------------------------------------------------------------------- |
| 82 | + | |
| 83 | + | Configure some DataCollectors |
| 84 | + | |
| 85 | + */ |
| 86 | + |
| 87 | + 'options' => [ |
| 88 | + 'time' => [ |
| 89 | + 'memory_usage' => false, // Calculated by subtracting memory start and end, it may be inaccurate |
| 90 | + ], |
| 91 | + 'messages' => [ |
| 92 | + 'trace' => true, // Trace the origin of the debug message |
| 93 | + ], |
| 94 | + 'memory' => [ |
| 95 | + 'reset_peak' => false, // run memory_reset_peak_usage before collecting |
| 96 | + 'with_baseline' => false, // Set boot memory usage as memory peak baseline |
| 97 | + 'precision' => 0, // Memory rounding precision |
| 98 | + ], |
| 99 | + 'auth' => [ |
| 100 | + 'show_name' => true, // Also show the users name/email in the debugbar |
| 101 | + 'show_guards' => true, // Show the guards that are used |
| 102 | + ], |
| 103 | + 'db' => [ |
| 104 | + 'with_params' => true, // Render SQL with the parameters substituted |
| 105 | + 'exclude_paths' => [ // Paths to exclude entirely from the collector |
| 106 | + 'vendor/laravel/framework/src/Illuminate/Session', // Exclude sessions queries |
| 107 | + ], |
| 108 | + 'backtrace' => true, // Use a backtrace to find the origin of the query in your files. |
| 109 | + 'backtrace_exclude_paths' => [], // Paths to exclude from backtrace. (in addition to defaults) |
| 110 | + 'timeline' => false, // Add the queries to the timeline |
| 111 | + 'duration_background' => true, // Show shaded background on each query relative to how long it took to execute. |
| 112 | + 'explain' => [ // Show EXPLAIN output on queries |
| 113 | + 'enabled' => false, |
| 114 | + ], |
| 115 | + 'hints' => false, // Show hints for common mistakes |
| 116 | + 'show_copy' => true, // Show copy button next to the query, |
| 117 | + 'slow_threshold' => false, // Only track queries that last longer than this time in ms |
| 118 | + 'memory_usage' => false, // Show queries memory usage |
| 119 | + 'soft_limit' => 100, // After the soft limit, no parameters/backtrace are captured |
| 120 | + 'hard_limit' => 500, // After the hard limit, queries are ignored |
| 121 | + ], |
| 122 | + 'mail' => [ |
| 123 | + 'timeline' => false, // Add mails to the timeline |
| 124 | + 'show_body' => true, |
| 125 | + ], |
| 126 | + 'views' => [ |
| 127 | + 'timeline' => false, // Add the views to the timeline (Experimental) |
| 128 | + 'data' => false, //true for all data, 'keys' for only names, false for no parameters. |
| 129 | + 'group' => 50, // Group duplicate views. Pass value to auto-group, or true/false to force |
| 130 | + 'exclude_paths' => [ // Add the paths which you don't want to appear in the views |
| 131 | + 'vendor/filament' // Exclude Filament components by default |
| 132 | + ], |
| 133 | + ], |
| 134 | + 'route' => [ |
| 135 | + 'label' => true, // show complete route on bar |
| 136 | + ], |
| 137 | + 'session' => [ |
| 138 | + 'hiddens' => [], // hides sensitive values using array paths |
| 139 | + ], |
| 140 | + 'symfony_request' => [ |
| 141 | + 'hiddens' => [], // hides sensitive values using array paths, example: request_request.password |
| 142 | + ], |
| 143 | + 'events' => [ |
| 144 | + 'data' => false, // collect events data, listeners |
| 145 | + ], |
| 146 | + 'logs' => [ |
| 147 | + 'file' => null, |
| 148 | + ], |
| 149 | + 'cache' => [ |
| 150 | + 'values' => true, // collect cache values |
| 151 | + ], |
| 152 | + ], |
| 153 | + |
| 154 | + |
| 155 | +``` |
0 commit comments