diff --git a/Drupal_Apache_Solr_Service.php b/Drupal_Apache_Solr_Service.php
index a99a567..a3f482c 100644
--- a/Drupal_Apache_Solr_Service.php
+++ b/Drupal_Apache_Solr_Service.php
@@ -440,8 +440,9 @@ class DrupalApacheSolrService implements DrupalApacheSolrServiceInterface {
       $caller = $this->findCaller();
       watchdog(
         'Apache Solr',
-        t('HTTP Status: %http_status; <br>Message: %status_message; <br>Response: %response; <br>Request: %request; <br>Caller: %function (line %line of %file)'),
+        t('Environment @env_id; HTTP Status: %http_status; <br>Message: %status_message; <br>Response: %response; <br>Request: %request; <br>Caller: %function (line %line of %file)'),
         array(
+          '@env_id' => $this->getId(),
           '%http_status' => $code,
           '%status_message' => $response->status_message,
           '%response' => $response->data,
@@ -477,18 +478,20 @@ class DrupalApacheSolrService implements DrupalApacheSolrServiceInterface {
   public function findCaller() {
     $stack = debug_backtrace();
     $stack_count = count($stack);
+    $which = -1;
     for ($i = 0; $i < $stack_count; ++$i) {
-      if (!isset($stack[$i]['file']) || strpos($stack[$i]['file'], DIRECTORY_SEPARATOR . 'apachesolr' . DIRECTORY_SEPARATOR) === FALSE) {
-        return array(
-          'file' => isset($stack[$i]['file']) ? $stack[$i]['file'] : t('Unknown'),
-          'line' => isset($stack[$i]['line']) ? $stack[$i]['line'] : t('Unknown'),
-          'function' => $stack[$i + 1]['function'],
-          'class' => isset($stack[$i + 1]['class']) ? $stack[$i + 1]['class'] : NULL,
-          'type' => isset($stack[$i + 1]['type']) ? $stack[$i + 1]['type'] : NULL,
-          'args' => $stack[$i + 1]['args'],
-        );
+      if (isset($stack[$i]['file']) && strpos($stack[$i]['file'], DIRECTORY_SEPARATOR . 'apachesolr' . DIRECTORY_SEPARATOR) === FALSE) {
+        $which = $i;
       }
     }
+    return array(
+      'file' => isset($stack[$which]['file']) ? $stack[$which]['file'] : t('Unknown'),
+      'line' => isset($stack[$which]['line']) ? $stack[$which]['line'] : t('Unknown'),
+      'function' => isset($stack[$which + 1]['function']) ? $stack[$which + 1]['function'] : t('Unknown'),
+      'class' => isset($stack[$which + 1]['class']) ? $stack[$which + 1]['class'] : NULL,
+      'type' => isset($stack[$which + 1]['type']) ? $stack[$which + 1]['type'] : NULL,
+      'args' => isset($stack[$which + 1]['args']) ? $stack[$which + 1]['args'] : NULL,
+    );
   }
 
   /**
diff --git a/apachesolr.admin.inc b/apachesolr.admin.inc
index f84d503..46c50e7 100644
--- a/apachesolr.admin.inc
+++ b/apachesolr.admin.inc
@@ -562,7 +562,7 @@ function apachesolr_status_page($environment = array()) {
     $data = $solr->getLuke();
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+    apachesolr_log_exception($environment['env_id'], $e);
     drupal_set_message(nl2br(check_plain($e->getMessage())), "warning");
     $data = new stdClass;
     $data->fields = array();
@@ -607,7 +607,7 @@ function apachesolr_status_page($environment = array()) {
       $messages[] = array(t('Pending Deletions'), t('@deletes_total', $stats_summary));
     }
     catch (Exception $e) {
-      watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+      apachesolr_log_exception($environment['env_id'], $e);
     }
   }
   if (empty($messages)) {
@@ -667,7 +667,7 @@ function apachesolr_index_report(array $environment = array()) {
     $data = $solr->getLuke();
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+    apachesolr_log_exception($environment['env_id'], $e);
     drupal_set_message(nl2br(check_plain($e->getMessage())), "warning");
     return $output;
   }
@@ -691,7 +691,7 @@ function apachesolr_index_report(array $environment = array()) {
       }
     }
     catch (Exception $e) {
-      watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+      apachesolr_log_exception($environment['env_id'], $e);
       $data->fields = array();
     }
   }
@@ -764,7 +764,7 @@ function apachesolr_config_files_overview(array $environment = array()) {
     $xml = simplexml_load_string($response->data);
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+    apachesolr_log_exception($env_id, $e);
     drupal_set_message(nl2br(check_plain($e->getMessage())), "warning");
   }
 
@@ -844,7 +844,7 @@ function apachesolr_config_file($name, array $environment = array()) {
     drupal_set_title(check_plain($name));
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+    apachesolr_log_exception($env_id, $e);
     drupal_set_message(nl2br(check_plain($e->getMessage())), "warning");
   }
   return $output;
@@ -1165,7 +1165,7 @@ function apachesolr_index_batch_index_entities($env_id, $total_limit = NULL, &$c
       }
     }
     catch (Exception $e) {
-      watchdog('Apache Solr', $e->getMessage(), NULL, WATCHDOG_ERROR);
+      apachesolr_log_exception($env_id, $e);
       return FALSE;
     }
 
diff --git a/apachesolr.index.inc b/apachesolr.index.inc
index 94588ef..572ac7b 100644
--- a/apachesolr.index.inc
+++ b/apachesolr.index.inc
@@ -45,7 +45,7 @@ function apachesolr_index_entities($env_id, $limit) {
     }
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+    apachesolr_log_exception($env_id, $e);
     return FALSE;
   }
 
@@ -76,8 +76,9 @@ function apachesolr_index_entities($env_id, $limit) {
         apachesolr_set_last_index_position($env_id, $entity_type, $last_row->changed, $last_row->entity_id);
       }
       else {
-        $message = 'Failure recording indexing progress. Last entity id processed: %entity_id with timestamp %last_changed';
+        $message = 'Environment @env_id: Failure recording indexing progress. Last entity id processed: %entity_id with timestamp %last_changed';
         $variables = array(
+          '@env_id' => $env_id,
           '%entity_id' => $last_row->entity_id,
           '%last_changed' => $last_row->changed,
         );
@@ -349,7 +350,7 @@ function apachesolr_index_send_to_solr($env_id, array $documents) {
   // Send the document off to Solr.
   $log_success = variable_get('apachesolr_watchdog_successes', TRUE);
   if ($log_success) {
-    watchdog('Apache Solr', 'Adding @count documents.', array('@count' => count($documents)));
+    watchdog('Apache Solr', 'Environment @env_id: Adding @count documents.', array('@env_id' => $env_id, '@count' => count($documents)));
   }
   try {
     $docs_chunk = array_chunk($documents, 20);
@@ -357,7 +358,8 @@ function apachesolr_index_send_to_solr($env_id, array $documents) {
       $solr->addDocuments($docs);
     }
     if ($log_success) {
-      watchdog('Apache Solr', 'Indexing succeeded on @count documents', array(
+      watchdog('Apache Solr', 'Environment @env_id: Indexing succeeded on @count documents', array(
+        '@env_id' => $env_id,
         '@count' => count($documents),
       ), WATCHDOG_INFO);
     }
@@ -369,7 +371,8 @@ function apachesolr_index_send_to_solr($env_id, array $documents) {
         $eids[] = $doc->entity_type . '/' . $doc->entity_id;
       }
     }
-    watchdog('Apache Solr', 'Indexing failed on one of the following entity ids: @eids <br /> !message', array(
+    watchdog('Apache Solr', 'Environment @env_id: Indexing failed on one of the following entity ids: @eids <br /> !message', array(
+      '@env_id' => $env_id,
       '@eids' => implode(', ', $eids),
       '!message' => nl2br(strip_tags($e->getMessage())),
     ), WATCHDOG_ERROR);
@@ -547,7 +550,7 @@ function apachesolr_index_get_entities_to_index($env_id, $entity_type, $limit) {
  */
 function apachesolr_index_delete_index($env_id, $entity_type = NULL, $bundle = NULL) {
   if (apachesolr_environment_variable_get($env_id, 'apachesolr_read_only', APACHESOLR_READ_WRITE) == APACHESOLR_READ_ONLY) {
-    watchdog('Apache Solr', 'Trying to update the Solr index while the environment %env_id is read-only in function %function', array('%function' => __FUNCTION__, '%env_id' => $env_id), WATCHDOG_WARNING);
+    watchdog('Apache Solr', 'Environment @env_id: Trying to update the Solr index while the environment is read-only in function %function', array('%function' => __FUNCTION__, '@env_id' => $env_id), WATCHDOG_WARNING);
     return FALSE;
   }
   // Instantiate a new Solr object.
@@ -572,7 +575,7 @@ function apachesolr_index_delete_index($env_id, $entity_type = NULL, $bundle = N
     // Log the query used for deletion.
     $log_success = variable_get('apachesolr_watchdog_successes', TRUE);
     if ($log_success) {
-      watchdog('Apache Solr', 'Deleted documents from index with query @query', array('@query' => $query), WATCHDOG_INFO);
+      watchdog('Apache Solr', 'Environment @env_id: Deleted documents from index with query @query', array('@env_id' => $env_id, '@query' => $query), WATCHDOG_INFO);
     }
 
     if (!empty($entity_type)) {
@@ -588,7 +591,7 @@ function apachesolr_index_delete_index($env_id, $entity_type = NULL, $bundle = N
     apachesolr_set_last_index_updated($env_id, REQUEST_TIME);
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+    apachesolr_log_exception($env_id, $e);
     return FALSE;
   }
   return TRUE;
@@ -656,7 +659,7 @@ function _apachesolr_index_get_next_set_query($env_id, $entity_type) {
  */
 function apachesolr_index_delete_bundles($env_id, $entity_type, array $excluded_bundles) {
   if (apachesolr_environment_variable_get($env_id, 'apachesolr_read_only', APACHESOLR_READ_WRITE) == APACHESOLR_READ_ONLY) {
-    watchdog('Apache Solr', 'Trying to update the Solr index while the environment %env_id is read-only in function %function', array('%function' => __FUNCTION__, '%env_id' => $env_id), WATCHDOG_WARNING);
+    watchdog('Apache Solr', 'Environment @env_id: Trying to update the Solr index while the environment is read-only in function %function', array('%function' => __FUNCTION__, '@env_id' => $env_id), WATCHDOG_WARNING);
     return FALSE;
   }
   // Remove newly omitted bundles.
@@ -674,7 +677,7 @@ function apachesolr_index_delete_bundles($env_id, $entity_type, array $excluded_
       // Log the query used for deletion.
       $log_success = variable_get('apachesolr_watchdog_successes', TRUE);
       if ($log_success) {
-        watchdog('Apache Solr', 'Deleted documents from index with query @query', array('@query' => $query), WATCHDOG_INFO);
+        watchdog('Apache Solr', 'Environment @env_id: Deleted documents from index with query @query', array('@env_id' => $env_id, '@query' => $query), WATCHDOG_INFO);
       }
     }
     if ($excluded_bundles) {
@@ -683,7 +686,7 @@ function apachesolr_index_delete_bundles($env_id, $entity_type, array $excluded_
     return TRUE;
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+    apachesolr_log_exception($env_id, $e);
     return FALSE;
   }
 }
@@ -706,7 +709,7 @@ function apachesolr_index_delete_entity_from_index($env_id, $entity_type, $entit
     return FALSE;
   }
   if (apachesolr_environment_variable_get($env_id, 'apachesolr_read_only', APACHESOLR_READ_WRITE) == APACHESOLR_READ_ONLY) {
-    watchdog('Apache Solr', 'Trying to update the Solr index while the environment %env_id is read-only in function %function', array('%function' => __FUNCTION__, '%env_id' => $env_id), WATCHDOG_WARNING);
+    watchdog('Apache Solr', 'Environment @env_id: Trying to update the Solr index while the environment is read-only in function %function', array('%function' => __FUNCTION__, '@env_id' => $env_id), WATCHDOG_WARNING);
     return FALSE;
   }
   try {
@@ -717,13 +720,13 @@ function apachesolr_index_delete_entity_from_index($env_id, $entity_type, $entit
     // Log the query used for deletion.
     $log_success = variable_get('apachesolr_watchdog_successes', TRUE);
     if ($log_success) {
-      watchdog('Apache Solr', 'Deleted documents from index with query @query', array('@query' => $query), WATCHDOG_INFO);
+      watchdog('Apache Solr', 'Environment @env_id: Deleted documents from index with query @query', array('@env_id' => $env_id, '@query' => $query), WATCHDOG_INFO);
     }
     apachesolr_set_last_index_updated($env_id, REQUEST_TIME);
     return TRUE;
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+    apachesolr_log_exception($env_id, $e);
     // Don't keep trying queries if they are failing.
     $failed = TRUE;
     return FALSE;
@@ -1443,11 +1446,13 @@ function apachesolr_index_node_check_table() {
 
 /**
  * Mass Update nodes from the solr indexer table
+ * TODO: This always assumes the default environment!
  *
  * @param array $nodes
  * @param string $table
  * @return boolean
  *   true if we mass updated, false if failed
+ *
  */
 function apachesolr_index_nodeapi_mass_update(array $nodes, $table = NULL) {
   if (empty($nodes)) {
@@ -1457,8 +1462,9 @@ function apachesolr_index_nodeapi_mass_update(array $nodes, $table = NULL) {
     $table = apachesolr_get_indexer_table('node');
   }
 
-  if (apachesolr_environment_variable_get(apachesolr_default_environment(), 'apachesolr_read_only', APACHESOLR_READ_WRITE) == APACHESOLR_READ_ONLY) {
-    watchdog('Apache Solr', 'Trying to update the Solr index while the environment %env_id is read-only in function %function', array('%function' => __FUNCTION__, '%env_id' => apachesolr_default_environment()), WATCHDOG_WARNING);
+  $env_id = apachesolr_default_environment();
+  if (apachesolr_environment_variable_get($env_id, 'apachesolr_read_only', APACHESOLR_READ_WRITE) == APACHESOLR_READ_ONLY) {
+    watchdog('Apache Solr', 'Environment @env_id: Trying to update the Solr index while the environment is read-only in function %function', array('%function' => __FUNCTION__, '@env_id' => $env_id), WATCHDOG_WARNING);
     return FALSE;
   }
 
@@ -1473,7 +1479,6 @@ function apachesolr_index_nodeapi_mass_update(array $nodes, $table = NULL) {
     }
   }
   try {
-    $env_id = apachesolr_default_environment();
     $solr = apachesolr_get_solr($env_id);
     $solr->deleteByMultipleIds($unpublished_ids);
     apachesolr_set_last_index_updated($env_id, REQUEST_TIME);
@@ -1494,13 +1499,14 @@ function apachesolr_index_nodeapi_mass_update(array $nodes, $table = NULL) {
     return TRUE;
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+    apachesolr_log_exception($env_id, $e);
     return FALSE;
   }
 }
 
 /**
  * Mass delete nodes from the solr indexer tables.
+ * TODO: This always assumes the default environment!
  *
  * @param array $nodes
  * @param string $table
@@ -1515,8 +1521,9 @@ function apachesolr_index_nodeapi_mass_delete(array $nodes, $table = NULL) {
     $table = apachesolr_get_indexer_table('node');
   }
 
-  if (apachesolr_environment_variable_get(apachesolr_default_environment(), 'apachesolr_read_only', APACHESOLR_READ_WRITE) == APACHESOLR_READ_ONLY) {
-    watchdog('Apache Solr', 'Trying to update the Solr index while the environment %env_id is read-only in function %function', array('%function' => __FUNCTION__, '%env_id' => apachesolr_default_environment()), WATCHDOG_WARNING);
+  $env_id = apachesolr_default_environment();
+  if (apachesolr_environment_variable_get($env_id, 'apachesolr_read_only', APACHESOLR_READ_WRITE) == APACHESOLR_READ_ONLY) {
+    watchdog('Apache Solr', 'Environment @env_id: Trying to update the Solr index while the environment %env_id is read-only in function %function', array('%function' => __FUNCTION__, '@env_id' => $env_id), WATCHDOG_WARNING);
     return FALSE;
   }
 
@@ -1527,7 +1534,6 @@ function apachesolr_index_nodeapi_mass_delete(array $nodes, $table = NULL) {
     $nids[] = $node->nid;
   }
   try {
-    $env_id = apachesolr_default_environment();
     $solr = apachesolr_get_solr($env_id);
     $solr->deleteByMultipleIds($ids);
     apachesolr_set_last_index_updated($env_id, REQUEST_TIME);
@@ -1538,7 +1544,7 @@ function apachesolr_index_nodeapi_mass_delete(array $nodes, $table = NULL) {
     return TRUE;
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+    apachesolr_log_exception($env_id, $e);
     return FALSE;
   }
 }
diff --git a/apachesolr.module b/apachesolr.module
index b7556f3..0bc5b12 100644
--- a/apachesolr.module
+++ b/apachesolr.module
@@ -863,7 +863,7 @@ function apachesolr_clear_cache($env_id) {
     $solr->clearCache();
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+    apachesolr_log_exception($env_id, $e);
     drupal_set_message(nl2br(check_plain($e->getMessage())), 'warning');
   }
 }
@@ -875,13 +875,14 @@ function apachesolr_clear_cache($env_id) {
  * @todo This is not according to drupal code standards
  */
 function apachesolr_set_stats_message($text, $type = 'status', $repeat = FALSE) {
+  $env_id = apachesolr_default_environment();
   try {
-    $solr = apachesolr_get_solr();
+    $solr = apachesolr_get_solr($env_id);
     $stats_summary = $solr->getStatsSummary();
     drupal_set_message(check_plain(t($text, $stats_summary)), $type, FALSE);
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+    apachesolr_log_exception($env_id, $e);
   }
 }
 
@@ -1005,7 +1006,7 @@ function apachesolr_cron($env_id = NULL) {
       }
     }
     catch (Exception $e) {
-      watchdog('Apache Solr', nl2br(check_plain($e->getMessage())) . ' in apachesolr_cron', NULL, WATCHDOG_ERROR);
+      apachesolr_log_exception($env_id, $e);
     }
 
     // We can safely process the apachesolr_cron_limit nodes at a time without a
@@ -1488,7 +1489,7 @@ function apachesolr_server_status($url, $class = NULL) {
       $ping = @$solr->ping(variable_get('apachesolr_ping_timeout', 4));
     }
     catch (Exception $e) {
-      watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+      apachesolr_log_exception($url, $e);
     }
     $status[$key] = $ping;
   }
@@ -3033,3 +3034,26 @@ function apachesolr_ctools_environment_export($environment, $indent) {
   $additions_bottom = array('conf' => $environment->conf, 'index_bundles' => $index_bundles);
   return ctools_export_object('apachesolr_environment', $environment, $indent, NULL, $additions_top, $additions_bottom);
 }
+
+/**
+ * Log exceptions.
+ * @param $env_id
+ *   The environment ID.
+ * @param \Exception $e
+ */
+function apachesolr_log_exception($env_id, $exception) {
+  // TODO: Should we call watchdog_exception() from here?
+  $backtrace = $exception->getTrace();
+  $caller = _drupal_get_last_caller($backtrace);
+  watchdog(
+    'Apache Solr',
+    'Exception caught for function %function (line %line of %file), Environment @env_id: ' . nl2br(check_plain($exception->getMessage())),
+    array(
+      '%function' => $caller['function'],
+      '%file' => $caller['file'],
+      '%line' => $caller['line'],
+      '@env_id' => $env_id,
+    ),
+    WATCHDOG_ERROR
+  );
+}
diff --git a/apachesolr_search.admin.inc b/apachesolr_search.admin.inc
index 1386201..9a62324 100644
--- a/apachesolr_search.admin.inc
+++ b/apachesolr_search.admin.inc
@@ -594,7 +594,7 @@ function apachesolr_search_delete_search_page_confirm_submit($form, &$form_state
     'The %label search page configuration has been deleted.',
     array('%label' => $form_state['values']['label'])
   ));
-  watchdog('apachesolr_search', 'Deleted search page configuration "@page_id".', array('@page_id' => $form_state['values']['page_id']), WATCHDOG_NOTICE);
+  watchdog('Apache Solr', 'Deleted search page configuration "@page_id".', array('@page_id' => $form_state['values']['page_id']), WATCHDOG_NOTICE);
 
   // Rebuilds the menu cache.
   menu_rebuild();
@@ -650,7 +650,7 @@ function apachesolr_search_get_fields($environment = NULL) {
     return $fields;
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+    apachesolr_log_exception($env_id, $e);
     drupal_set_message(nl2br(check_plain($e->getMessage())), 'warning');
     drupal_set_message(t('Cannot get information about the fields in the index.'), 'warning');
   }
@@ -969,14 +969,16 @@ function apachesolr_search_mlt_block_defaults($block = array()) {
 
 /**
  * Constructs a list of field names used on the settings form.
+ * TODO: This always assumes the default environment!
  *
  * @return array An array containing a the fields in the solr instance.
  */
 function apachesolr_search_mlt_get_fields() {
   $rows = array();
 
+  $env_id = apachesolr_default_environment();
   try {
-    $solr = apachesolr_get_solr();
+    $solr = apachesolr_get_solr($env_id);
     $fields = $solr->getFields();
     foreach ($fields as $field_name => $field) {
       // 'V' appears in different positions in different Solr versions.
@@ -987,7 +989,7 @@ function apachesolr_search_mlt_get_fields() {
     ksort($rows);
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+    apachesolr_log_exception($env_id, $e);
   }
 
   return $rows;
diff --git a/apachesolr_search.module b/apachesolr_search.module
index f3a44af..7d75a69 100644
--- a/apachesolr_search.module
+++ b/apachesolr_search.module
@@ -82,7 +82,7 @@ function apachesolr_search_init() {
             }
           }
           catch (Exception $e) {
-            watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+            apachesolr_log_exception($search_page['env_id'], $e);
           }
         }
       }
@@ -552,7 +552,7 @@ function apachesolr_search_block_view($delta = '') {
         }
       }
       catch (Exception $e) {
-        watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+        apachesolr_log_exception($env_id, $e);
       }
     }
     return $suggestions;
@@ -714,7 +714,7 @@ function apachesolr_search_mlt_suggestions($settings, $id, $solr = NULL, $contex
     }
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+    apachesolr_log_exception($solr->getId(), $e);
   }
 }
 
@@ -934,7 +934,7 @@ function apachesolr_search_search_results($keys = NULL, $conditions = NULL, $sea
       }
     }
     catch (Exception $e) {
-      watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+      apachesolr_log_exception($search_page['env_id'], $e);
       apachesolr_failure(t('Solr search'), $keys);
     }
   }
@@ -1615,7 +1615,7 @@ function apachesolr_search_build_spellcheck($form, &$form_state) {
     $response = $solr->search('solr', $params);
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+    apachesolr_log_exception($env_id, $e);
   }
 }
 
