--- xmlsitemap_engines.module.orig	2015-01-19 15:06:27.534822000 -0500
+++ xmlsitemap_engines.module	2015-01-19 15:02:09.609331800 -0500
@@ -243,3 +243,43 @@ function xmlsitemap_engines_xmlsitemap_s
     return $operations;
   }
 }
+
+/**
+ * Implementation of hook_exit().
+ */
+function xmlsitemap_engines_exit() {
+  drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
+  if (variable_get('site_offline', 0) || arg(0) == 'batch') {
+    return;
+  }
+  if (variable_get('xmlsitemap_engines_log_access', FALSE)) {
+    if (arg(0) == 'sitemap.xml' && is_null(arg(1))) {
+      $write_log = TRUE;
+    }
+    if (isset($write_log)) {
+      watchdog('xmlsitemap', 'Sitemap downloaded by @user-agent at @address.',
+        array(
+          '@user-agent' => xmlsitemap_engines_search_engine_id(),
+          '@address' => ip_address(),
+        )
+      );
+    }
+  }
+/*
+  if (!isset($write_log) && variable_get('xmlsitemap_engines_submit', FALSE) && variable_get('xmlsitemap_sitemap_is_changed', FALSE)) {
+    xmlsitemap_engines_ping_sitemap();
+    variable_set('xmlsitemap_sitemap_is_changed', FALSE);
+  }
+*/
+}
+
+/**
+ * Return the identifier for the search engine that accessed to the sitemap,
+ * or the content of $_SERVER['HTTP_USER_AGENT'].
+ */
+function xmlsitemap_engines_search_engine_id() {
+  if (strpos($_SERVER['HTTP_USER_AGENT'], 'Googlebot') !== FALSE) {
+    return 'Google';
+  }
+  return $_SERVER['HTTP_USER_AGENT'];
+}
