Yii2 Debug toolbar - allow DB logs with an admin account #14985
-
I build this functionality for my Craft 3 projects via events and different config values but it seems Craft 4/5 made it nearly unable to activate logging with an admin account without heavy customizations. I often need to use the Yii2 Debug toolbar in production but the most important thing - the logs, especially the DB logs - are missing. It would be awesome if there was a native setting for user preferences to include profiles and logs in the debug toolbar while in production mode |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Since Craft 4, DB profiling and logging are only enabled for Dev Mode by default, but you can customize it by overriding the return [
'components' => [
'db' => function() {
$config = craft\helpers\App::dbConfig();
$config['enableLogging'] = true;
$config['enableProfiling'] = true;
return Craft::createObject($config);
},
],
]; |
Beta Was this translation helpful? Give feedback.
Since Craft 4, DB profiling and logging are only enabled for Dev Mode by default, but you can customize it by overriding the
db
component config inconfig/app.php
: