diff --git a/src/ConfigImporter.php b/src/ConfigImporter.php
index 9969ab5..7599af2 100644
--- a/src/ConfigImporter.php
+++ b/src/ConfigImporter.php
@@ -110,7 +110,7 @@ class ConfigImporter {
         $message = 'The import failed due to the following reasons:' . "\n";
         $message .= implode("\n", $config_importer->getErrors());
 
-        watchdog_exception('config_import', $e);
+        \Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '10.1.0', fn() => \Drupal\Core\Utility\Error::logException(\Drupal::logger('config_import'), $e), fn() => watchdog_exception('config_import', $e));
         throw new \Exception($message);
       }
     }
