diff --git a/core/modules/dblog/src/Form/DblogClearLogConfirmForm.php b/core/modules/dblog/src/Form/DblogClearLogConfirmForm.php
index 9076fc5..8de2f2f 100644
--- a/core/modules/dblog/src/Form/DblogClearLogConfirmForm.php
+++ b/core/modules/dblog/src/Form/DblogClearLogConfirmForm.php
@@ -14,32 +14,6 @@
 class DblogClearLogConfirmForm extends ConfirmFormBase {
 
   /**
-   * The database connection.
-   *
-   * @var \Drupal\Core\Database\Connection
-   */
-  protected $connection;
-
-  /**
-   * Constructs a new DblogClearLogConfirmForm.
-   *
-   * @param \Drupal\Core\Database\Connection $connection
-   *   The database connection.
-   */
-  public function __construct(Connection $connection) {
-    $this->connection = $connection;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function create(ContainerInterface $container) {
-    return new static(
-      $container->get('database')
-    );
-  }
-
-  /**
    * {@inheritdoc}
    */
   public function getFormId() {
@@ -65,7 +39,7 @@ public function getCancelUrl() {
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
     $_SESSION['dblog_overview_filter'] = array();
-    $this->connection->delete('watchdog')->execute();
+    \Drupal::service('logger.dblog')->clearAllLogs();
     drupal_set_message($this->t('Database log cleared.'));
     $form_state->setRedirectUrl($this->getCancelUrl());
   }
diff --git a/core/modules/dblog/src/Form/DblogClearLogForm.php b/core/modules/dblog/src/Form/DblogClearLogForm.php
index 134cfc1..80e4958 100644
--- a/core/modules/dblog/src/Form/DblogClearLogForm.php
+++ b/core/modules/dblog/src/Form/DblogClearLogForm.php
@@ -13,32 +13,6 @@
 class DblogClearLogForm extends FormBase {
 
   /**
-   * The database connection.
-   *
-   * @var \Drupal\Core\Database\Connection
-   */
-  protected $connection;
-
-  /**
-   * Constructs a new DblogClearLogForm.
-   *
-   * @param \Drupal\Core\Database\Connection $connection
-   *   The database connection.
-   */
-  public function __construct(Connection $connection) {
-    $this->connection = $connection;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function create(ContainerInterface $container) {
-    return new static(
-      $container->get('database')
-    );
-  }
-
-  /**
    * {@inheritdoc}
    */
   public function getFormId() {
diff --git a/core/modules/dblog/src/Logger/DbLog.php b/core/modules/dblog/src/Logger/DbLog.php
index af77be4..8a85c49 100644
--- a/core/modules/dblog/src/Logger/DbLog.php
+++ b/core/modules/dblog/src/Logger/DbLog.php
@@ -109,4 +109,10 @@ public function log($level, $message, array $context = array()) {
     }
   }
 
+  /**
+   * Clear all the logs in the database.
+   */
+  public function clearAllLogs() {
+    $this->connection->delete('watchdog')->execute();
+  }
 }
