diff --git a/README.md b/README.md
index 94ebbae..f9edcbc 100644
--- a/README.md
+++ b/README.md
@@ -12,6 +12,13 @@ To install, use one of the following methods:
     # From your site's docroot.
     drush gelf-download
 
+3. Install via composer. In composer.json:
+    {
+      "require":{
+        "graylog2/gelf-php":"dev-master
+      }
+    }
+
 Older versions of the GELF PHP library contained the file 'gelf.php'.
 Newer versions have split that out into GELFMessage.php and
 GELFMessagePublisher.php. If your instance of gelf-php doesn't have
diff --git a/gelf.info b/gelf.info
index 081afb6..45716e6 100644
--- a/gelf.info
+++ b/gelf.info
@@ -1,5 +1,4 @@
 name = GELF
 description = "Sends watchdog messages to Graylog2 using the GELF format."
 core = 7.x
-dependencies[] = libraries
 configure = admin/config/development/logging
diff --git a/gelf.module b/gelf.module
index 146ab6b..69772aa 100644
--- a/gelf.module
+++ b/gelf.module
@@ -24,49 +24,45 @@ function gelf_permission() {
  * Implement hook_watchdog().
  */
 function gelf_watchdog($entry) {
-  if (module_exists('libraries') && $gelflib_path = libraries_get_path('gelf-php')) {
-    if (file_exists($gelflib_path . '/GELFMessage.php') && file_exists($gelflib_path . '/GELFMessagePublisher.php')) {
-      require_once $gelflib_path . '/GELFMessage.php';
-      require_once $gelflib_path . '/GELFMessagePublisher.php';
-      $host = variable_get('gelf_host', 'localhost');
-      $port = variable_get('gelf_port', 12201);
-      $gelf = new GELFMessage();
-      $message = filter_xss(is_null($entry['variables']) ? $entry['message'] : strtr($entry['message'], $entry['variables']));
-      $short_msg_length = 100;
-      if(strlen($message) > $short_msg_length) {
-        $short_message = preg_replace('/\s+?(\S+)?$/u', '', substr($message, 0, $short_msg_length));
-      }
-      else {
-        $short_message = $message;
-      }
-      $username = isset($entry['user']->name) ? $entry['user']->name : variable_get('anonymous', t('Anonymous'));
-      $gelf->setShortMessage($short_message);
-      $gelf->setFullMessage($message);
-      $gelf->setHost(php_uname('n'));
-      $gelf->setFacility($entry['type']);
-      $gelf->setLevel($entry['severity']);
-      $gelf->setTimestamp($entry['timestamp']);
-      $gelf->setAdditional("Referer", $entry['referer']);
-      $gelf->setAdditional("Link", $entry['link']);
-      $gelf->setAdditional("Username", $username);
-      $gelf->setAdditional("Uid", $entry['user']->uid);
-      $gelf->setAdditional("Request_uri", $entry['request_uri']);
-      $gelf->setAdditional("Server_host", $_SERVER['HTTP_HOST']);
-      $gelf->setAdditional("Client_host", $entry['ip']);
-      try {
-        $publisher = new GELFMessagePublisher($host, $port);
-        $publisher->publish($gelf);
-      }
-      catch (UnexpectedValueException $e) {
-        if(user_access('administer gelf')) {
-          drupal_set_message(t('Failed to publish gelf message: %message', array('%message' => $e->getMessage())), 'error');
-        }
-      }
+  if (!gelf_require()) {
+    if(user_access('administer gelf')) {
+      drupal_set_message(t('GELF module requires the GELF PHP library to be installed.  View the README for installation instructions.'), 'error');
     }
+    return;
+  }
+
+  $host = variable_get('gelf_host', 'localhost');
+  $port = variable_get('gelf_port', 12201);
+  $gelf = new GELFMessage();
+  $message = filter_xss(is_null($entry['variables']) ? $entry['message'] : strtr($entry['message'], $entry['variables']));
+  $short_msg_length = 100;
+  if(strlen($message) > $short_msg_length) {
+    $short_message = preg_replace('/\s+?(\S+)?$/u', '', substr($message, 0, $short_msg_length));
   }
   else {
+    $short_message = $message;
+  }
+  $username = isset($entry['user']->name) ? $entry['user']->name : variable_get('anonymous', t('Anonymous'));
+  $gelf->setShortMessage($short_message);
+  $gelf->setFullMessage($message);
+  $gelf->setHost(php_uname('n'));
+  $gelf->setFacility($entry['type']);
+  $gelf->setLevel($entry['severity']);
+  $gelf->setTimestamp($entry['timestamp']);
+  $gelf->setAdditional("Referer", $entry['referer']);
+  $gelf->setAdditional("Link", $entry['link']);
+  $gelf->setAdditional("Username", $username);
+  $gelf->setAdditional("Uid", $entry['user']->uid);
+  $gelf->setAdditional("Request_uri", $entry['request_uri']);
+  $gelf->setAdditional("Server_host", $_SERVER['HTTP_HOST']);
+  $gelf->setAdditional("Client_host", $entry['ip']);
+  try {
+    $publisher = new GELFMessagePublisher($host, $port);
+    $publisher->publish($gelf);
+  }
+  catch (UnexpectedValueException $e) {
     if(user_access('administer gelf')) {
-      drupal_set_message(t('GELF module requires libraries to be installed!'), 'error');
+      drupal_set_message(t('Failed to publish gelf message: %message', array('%message' => $e->getMessage())), 'error');
     }
   }
 }
@@ -87,10 +83,36 @@ function gelf_form_system_logging_settings_alter(&$form, $form_state) {
     '#default_value' => variable_get('gelf_port', 12201),
   );
 
-  $gelflib_path = libraries_get_path('gelf-php');
-  if (!file_exists($gelflib_path . '/GELFMessage.php') || !file_exists($gelflib_path . '/GELFMessagePublisher.php')) {
+  if (!gelf_require()) {
     drupal_set_message(t('GELF module requires the GELF PHP library to be installed.  View the README for installation instructions.'), 'error');
   }
 
   return $form;
 }
+
+
+/**
+ * Include gelf-php library.
+ *
+ * @return boolean
+ */
+function gelf_require() {
+  // Allow the classes to be autoloaded; also short circuit once required.
+  if (class_exists('GELFMessage') && class_exists('GELFMessagePublisher')) {
+    return TRUE;
+  }
+
+  // Check if the libraries dependency is installed
+  if (module_exists('libraries')) {
+    $gelfmsg_path = libraries_get_path('gelf-php') . '/GELFMessage.php';
+    $gelfpub_path = libraries_get_path('gelf-php') . '/GELFMessagePublisher.php';
+
+    // Check if the php-gelf library is available
+    if (file_exists(DRUPAL_ROOT . '/' . $gelfmsg_path) && file_exists(DRUPAL_ROOT . '/' . $gelfpub_path)) {
+      require_once DRUPAL_ROOT . '/' . $gelfmsg_path;
+      require_once DRUPAL_ROOT . '/' . $gelfpub_path;
+      return TRUE;
+    }
+  }
+  return FALSE;
+}
