diff --git a/memcache.module b/memcache.module
deleted file mode 100644
index 0c5ef8c..0000000
--- a/memcache.module
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-/**
- * @file
- * Memcache module file.
- */
-
-
-/**
- * Log error.
- *
- * @param string $context
- *   Context (class and function name).
- * @param string $message
- *   Message to log.
- * @param int $level
- *   Error level.
- */
-function memcache_log_warning($level, $message, $context) {
-  \Drupal::logger('memcache')->log($level, $message, $context);
-}
diff --git a/memcache.services.yml b/memcache.services.yml
index 1e85ebd..e9c7ce5 100644
--- a/memcache.services.yml
+++ b/memcache.services.yml
@@ -4,10 +4,13 @@ services:
     arguments: ['@settings']
   memcache.factory:
     class: Drupal\memcache\DrupalMemcacheFactory
-    arguments: ['@memcache.config']
+    arguments: ['@memcache.config', '@logger.channel.memcache']
   cache.backend.memcache:
     class: Drupal\memcache\MemcacheBackendFactory
     arguments: ['@lock', '@memcache.config', '@memcache.factory', '@cache_tags.invalidator.checksum']
   memcache.lock.factory:
     class: Drupal\memcache\Lock\MemcacheLockFactory
     arguments: ['@memcache.factory']
+  logger.channel.memcache:
+    parent: logger.channel_base
+    arguments: ['memcache']
\ No newline at end of file
diff --git a/src/DrupalMemcache.php b/src/DrupalMemcache.php
index c00d0da..2a618ed 100644
--- a/src/DrupalMemcache.php
+++ b/src/DrupalMemcache.php
@@ -7,7 +7,7 @@
 
 namespace Drupal\memcache;
 
-use Psr\Log\LogLevel;
+use Psr\Log\LoggerInterface;
 
 /**
  * Class DrupalMemcache.
@@ -17,8 +17,8 @@ class DrupalMemcache extends DrupalMemcacheBase {
   /**
    * {@inheritdoc}
    */
-  public function __construct(DrupalMemcacheConfig $settings) {
-    parent::__construct($settings);
+  public function __construct(DrupalMemcacheConfig $settings, LoggerInterface $logger) {
+    parent::__construct($settings, $logger);
 
     $this->memcache = new \Memcache();
   }
@@ -91,7 +91,7 @@ class DrupalMemcache extends DrupalMemcacheBase {
     $results = @$this->memcache->get($full_keys);
 
     if (!empty($php_errormsg)) {
-      register_shutdown_function('memcache_log_warning', LogLevel::WARNING, 'Exception caught in DrupalMemcache::getMulti: !msg', array('!msg' => $php_errormsg));
+      $this->logger->warning('Exception caught in DrupalMemcache::getMulti: !msg', ['!msg' => $php_errormsg]);
       $php_errormsg = '';
     }
 
diff --git a/src/DrupalMemcacheBase.php b/src/DrupalMemcacheBase.php
index 3199e2d..932df22 100644
--- a/src/DrupalMemcacheBase.php
+++ b/src/DrupalMemcacheBase.php
@@ -7,7 +7,7 @@
 
 namespace Drupal\memcache;
 
-use Psr\Log\LogLevel;
+use Psr\Log\LoggerInterface;
 
 /**
  * Class DrupalMemcacheBase.
@@ -44,16 +44,27 @@ abstract class DrupalMemcacheBase implements DrupalMemcacheInterface {
   protected $prefix;
 
   /**
+   * A logger instance.
+   *
+   * @var \Psr\Log\LoggerInterface
+   */
+  protected $logger;
+
+  /**
    * Constructs a DrupalMemcacheBase object.
    *
-   * @param \Drupal\memcache\DrupalMemcacheConfig
+   * @param \Drupal\memcache\DrupalMemcacheConfig $settings
    *   The memcache config object.
+   * @param \Psr\Log\LoggerInterface $logger
+   *   A logger instance.
    */
-  public function __construct(DrupalMemcacheConfig $settings) {
+  public function __construct(DrupalMemcacheConfig $settings, LoggerInterface $logger) {
     $this->settings = $settings;
 
     $this->hashAlgorithm = $this->settings->get('key_hash_algorithm', 'sha1');
     $this->prefix = $this->settings->get('key_prefix', '');
+
+    $this->logger = $logger;
   }
 
   /**
@@ -67,7 +78,7 @@ abstract class DrupalMemcacheBase implements DrupalMemcacheInterface {
     $result = @$this->memcache->get($full_key);
 
     if (!empty($php_errormsg)) {
-      register_shutdown_function('memcache_log_warning', LogLevel::WARNING, 'Exception caught in DrupalMemcacheBase::get: !msg', array('!msg' => $php_errormsg));
+      $this->logger->warning('Exception caught in DrupalMemcacheBase::get: !msg', ['!msg' => $php_errormsg]);
       $php_errormsg = '';
     }
     ini_set('track_errors', $track_errors);
diff --git a/src/DrupalMemcacheFactory.php b/src/DrupalMemcacheFactory.php
index fd2ef61..c18759a 100644
--- a/src/DrupalMemcacheFactory.php
+++ b/src/DrupalMemcacheFactory.php
@@ -52,13 +52,23 @@ class DrupalMemcacheFactory {
   protected $failedConnectionCache = array();
 
   /**
+   * A logger instance.
+   *
+   * @var \Psr\Log\LoggerInterface
+   */
+  protected $logger;
+
+  /**
    * Constructs a DrupalMemcacheFactory object.
    *
    * @param \Drupal\memcache\DrupalMemcacheConfig $settings
+   *   A Settings Object.
+   * @param \Psr\Log\LoggerInterface $logger
+   *   A logger instance.
    */
-  public function __construct(DrupalMemcacheConfig $settings) {
+  public function __construct(DrupalMemcacheConfig $settings, LoggerInterface $logger) {
     $this->settings = $settings;
-
+    $this->logger = $logger;
     $this->initialize();
   }
 
@@ -95,10 +105,10 @@ class DrupalMemcacheFactory {
         // object.
         // @todo Can't add a custom memcache class here yet.
         if ($this->extension == 'Memcached') {
-          $memcache = new DrupalMemcached($this->settings);
+          $memcache = new DrupalMemcached($this->settings, $this->logger);
         }
         elseif ($this->extension == 'Memcache') {
-          $memcache = new DrupalMemcache($this->settings);
+          $memcache = new DrupalMemcache($this->settings, $this->logger);
         }
 
         // A variable to track whether we've connected to the first server.
@@ -112,10 +122,7 @@ class DrupalMemcacheFactory {
             }
 
             if (!$init) {
-              // We can't use watchdog because this happens in a bootstrap phase
-              // where watchdog is non-functional. Register a shutdown handler
-              // instead so it gets recorded at the end of page load.
-              register_shutdown_function('memcache_log_warning', LogLevel::ERROR, 'Failed to connect to memcache server: !server', array('!server' => $s));
+              $this->logger->warning('Failed to connect to memcache server: !server', ['!server' => $s]);
               $this->failedConnectionCache[$s] = FALSE;
             }
           }
