You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you're using DDEV, you can see the database from a PHPMyAdmin interface in: https://myname.ddev.site:8037. You can see all the tables there, included the log registers by default in Drupal, the so called "watchdog" table, with annotations about all the incidences in your Drupal installation. This table is managed by the Dblog module, present in Drupal core.
The watchdogtable contains columns as: uid (user triggering the event), the type of the log message, the severity of the event, a location url, a timestamp and many others.
Sometimes the watchdog table can grow out of control, so you can get a lot of errors from MySQL and/or slow down the performance of your Drupal installation. You must learn how to reduce the table, truncate it, delete certain records, etc. And perhaps you may have to turn off this module in Live / Production Environments.
$num_deleted = $connection->delete('watchdog')
->condition('type', 'cron')
->execute();
// Is just like: DELETE FROM {watchdog} WHERE type='cron';
// Dynamic queries in Drupal database API.$database = \Drupal::database();
$query = $database->truncate('watchdog');
$query->execute();
// Or
\Drupal::database()->truncate('watchdog')->execute();
// Truncates the whole table.
Or by doing:
// Static queries in Drupal database API using db_query() function. $query = db_query("TRUNCATE TABLE watchdog");
// Or DELETEFROM {watchdog} WHERE type='cron
$query = db_query("DELETE FROM {watchdog} WHERE type = 'cron'");
$records = $query->fetchAll();