gora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lewi...@apache.org
Subject gora git commit: GORA-410 Change logging behavior to pass exception object to LOG methods
Date Sun, 22 Feb 2015 21:48:26 GMT
Repository: gora
Updated Branches:
  refs/heads/master 61a4747ff -> 65d6c7ac2


GORA-410 Change logging behavior to pass exception object to LOG methods


Project: http://git-wip-us.apache.org/repos/asf/gora/repo
Commit: http://git-wip-us.apache.org/repos/asf/gora/commit/65d6c7ac
Tree: http://git-wip-us.apache.org/repos/asf/gora/tree/65d6c7ac
Diff: http://git-wip-us.apache.org/repos/asf/gora/diff/65d6c7ac

Branch: refs/heads/master
Commit: 65d6c7ac29d2cc041d067e5e7f0857936a7529d7
Parents: 61a4747
Author: Lewis John McGibbney <lewis.j.mcgibbney@jpl.nasa.gov>
Authored: Sun Feb 22 13:48:38 2015 -0800
Committer: Lewis John McGibbney <lewis.j.mcgibbney@jpl.nasa.gov>
Committed: Sun Feb 22 13:48:38 2015 -0800

----------------------------------------------------------------------
 CHANGES.txt                                     |  2 +
 .../gora/cassandra/store/CassandraStore.java    |  3 +-
 .../org/apache/gora/avro/store/AvroStore.java   |  9 ++---
 .../gora/avro/store/DataFileAvroStore.java      | 15 +++----
 .../apache/gora/store/impl/DataStoreBase.java   | 15 +++----
 .../store/impl/FileBackedDataStoreBase.java     | 18 +++------
 .../gora/dynamodb/store/DynamoDBStore.java      |  6 +--
 .../org/apache/gora/hbase/store/HBaseStore.java | 42 +++++++-------------
 .../org/apache/gora/solr/store/SolrStore.java   | 30 +++++++-------
 9 files changed, 52 insertions(+), 88 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/gora/blob/65d6c7ac/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index b76d303..d148e31 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -4,6 +4,8 @@
 
 Apache Gora 0.7 Release 
 
+* GORA-410 Change logging behavior to pass exception object to LOG methods (Gerhard Gossen
via lewismc)
+
 * GORA-330 Import Gora Gradle plugin (drazzib)
 
 

http://git-wip-us.apache.org/repos/asf/gora/blob/65d6c7ac/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
----------------------------------------------------------------------
diff --git a/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
b/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
index 95f8090..dc4cf06 100644
--- a/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
+++ b/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
@@ -150,8 +150,7 @@ public class CassandraStore<K, T extends PersistentBase> extends
DataStoreBase<K
       }
       this.cassandraClient.initialize(keyClass, persistent, properties);
     } catch (Exception e) {
-      LOG.error(e.getMessage());
-      LOG.error(e.getStackTrace().toString());
+      LOG.error(e.getMessage(), e);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/gora/blob/65d6c7ac/gora-core/src/main/java/org/apache/gora/avro/store/AvroStore.java
----------------------------------------------------------------------
diff --git a/gora-core/src/main/java/org/apache/gora/avro/store/AvroStore.java b/gora-core/src/main/java/org/apache/gora/avro/store/AvroStore.java
index f08468b..817885d 100644
--- a/gora-core/src/main/java/org/apache/gora/avro/store/AvroStore.java
+++ b/gora-core/src/main/java/org/apache/gora/avro/store/AvroStore.java
@@ -121,8 +121,7 @@ public class AvroStore<K, T extends PersistentBase>
       encoder = null;
       decoder = null;
     }catch(IOException ex){
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
     }
   }
 
@@ -162,8 +161,7 @@ public class AvroStore<K, T extends PersistentBase>
       if(encoder != null)
         encoder.flush();
     }catch(IOException ex){
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
     }
   }
 
@@ -182,8 +180,7 @@ public class AvroStore<K, T extends PersistentBase>
     try{
       getDatumWriter().write(obj, getEncoder());
     }catch(IOException ex){
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/gora/blob/65d6c7ac/gora-core/src/main/java/org/apache/gora/avro/store/DataFileAvroStore.java
----------------------------------------------------------------------
diff --git a/gora-core/src/main/java/org/apache/gora/avro/store/DataFileAvroStore.java b/gora-core/src/main/java/org/apache/gora/avro/store/DataFileAvroStore.java
index 4bade04..e1110ea 100644
--- a/gora-core/src/main/java/org/apache/gora/avro/store/DataFileAvroStore.java
+++ b/gora-core/src/main/java/org/apache/gora/avro/store/DataFileAvroStore.java
@@ -59,8 +59,7 @@ public class DataFileAvroStore<K, T extends PersistentBase> extends
AvroStore<K,
     try{
       getWriter().append(obj);
     } catch(IOException ex){
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
     }
   };
   
@@ -78,8 +77,7 @@ public class DataFileAvroStore<K, T extends PersistentBase> extends
AvroStore<K,
       return new DataFileAvroResult<K, T>(this, query
           , createReader(createFsInput()));
     } catch(IOException ex){
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
       return null;
     }
   }
@@ -92,8 +90,7 @@ public class DataFileAvroStore<K, T extends PersistentBase> extends
AvroStore<K,
       return new DataFileAvroResult<K, T>(this, query, reader, fsInput
           , query.getStart(), query.getLength());
     } catch(IOException ex){
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
       return null;
     }
   }
@@ -115,8 +112,7 @@ public class DataFileAvroStore<K, T extends PersistentBase> extends
AvroStore<K,
         writer.flush();
       }
     } catch(IOException ex){
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
     }
   }
   
@@ -129,8 +125,7 @@ public class DataFileAvroStore<K, T extends PersistentBase> extends
AvroStore<K,
       writer = null;
       super.close();
     } catch(IOException ex){
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/gora/blob/65d6c7ac/gora-core/src/main/java/org/apache/gora/store/impl/DataStoreBase.java
----------------------------------------------------------------------
diff --git a/gora-core/src/main/java/org/apache/gora/store/impl/DataStoreBase.java b/gora-core/src/main/java/org/apache/gora/store/impl/DataStoreBase.java
index 62c00d6..7ed11af 100644
--- a/gora-core/src/main/java/org/apache/gora/store/impl/DataStoreBase.java
+++ b/gora-core/src/main/java/org/apache/gora/store/impl/DataStoreBase.java
@@ -126,8 +126,7 @@ public abstract class DataStoreBase<K, T extends PersistentBase>
     try {
       return beanFactory.newKey();
     } catch (Exception ex) {
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
       return null;
     }
   }
@@ -137,8 +136,7 @@ public abstract class DataStoreBase<K, T extends PersistentBase>
     try {
       return beanFactory.newPersistent();
     } catch (Exception ex) {
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
       return null;
     }
   }
@@ -214,11 +212,9 @@ public abstract class DataStoreBase<K, T extends PersistentBase>
       Properties props = WritableUtils.readProperties(in);
       initialize(keyClass, persistentClass, props);
     } catch (ClassNotFoundException ex) {
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
     } catch (IOException e) {
-      LOG.error(e.getMessage());
-      LOG.error(e.getStackTrace().toString());
+      LOG.error(e.getMessage(), e);
     }
   }
 
@@ -228,8 +224,7 @@ public abstract class DataStoreBase<K, T extends PersistentBase>
       Text.writeString(out, getPersistentClass().getCanonicalName());
       WritableUtils.writeProperties(out, properties);
     } catch (IOException e) {
-      LOG.error(e.getMessage());
-      LOG.error(e.getStackTrace().toString());
+      LOG.error(e.getMessage(), e);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/gora/blob/65d6c7ac/gora-core/src/main/java/org/apache/gora/store/impl/FileBackedDataStoreBase.java
----------------------------------------------------------------------
diff --git a/gora-core/src/main/java/org/apache/gora/store/impl/FileBackedDataStoreBase.java
b/gora-core/src/main/java/org/apache/gora/store/impl/FileBackedDataStoreBase.java
index deab67d..de14f4a 100644
--- a/gora-core/src/main/java/org/apache/gora/store/impl/FileBackedDataStoreBase.java
+++ b/gora-core/src/main/java/org/apache/gora/store/impl/FileBackedDataStoreBase.java
@@ -134,8 +134,7 @@ public InputStream getInputStream() {
       FileSystem fs = path.getFileSystem(getConf());
       conf = fs.create(path);
     }catch(IOException ex){
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
     }
     return conf;
   }
@@ -170,8 +169,7 @@ public InputStream getInputStream() {
         queries.add(new FileSplitPartitionQuery<K, T>(query, (FileSplit) split));
       }
     }catch(IOException ex){
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
     }
     return queries;
   }
@@ -186,8 +184,7 @@ public InputStream getInputStream() {
         results = executeQuery(query);
       }
     }catch(IOException ex){
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
     }
     return results;
   }
@@ -211,8 +208,7 @@ public InputStream getInputStream() {
       if(outputStream != null)
         outputStream.flush();
     }catch(IOException ex){
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
     }
   }
 
@@ -241,8 +237,7 @@ public InputStream getInputStream() {
       if(outputPath != null)
         Text.writeString(out, outputPath);
     }catch(IOException ex){
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
     }
   }
 
@@ -256,8 +251,7 @@ public InputStream getInputStream() {
       if(!nullFields[1])
         outputPath = Text.readString(in);
     }catch(IOException ex){
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/gora/blob/65d6c7ac/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/store/DynamoDBStore.java
----------------------------------------------------------------------
diff --git a/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/store/DynamoDBStore.java
b/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/store/DynamoDBStore.java
index ee48542..83e904f 100644
--- a/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/store/DynamoDBStore.java
+++ b/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/store/DynamoDBStore.java
@@ -170,8 +170,7 @@ public class DynamoDBStore<K, T extends Persistent> extends WSDataStoreBase<K,
T
     }
     catch (Exception e) {
       LOG.error("Error while initializing DynamoDB store");
-      LOG.error(e.getMessage());
-      LOG.error(e.getStackTrace().toString());
+      LOG.error(e.getMessage(), e);
     }
   }
   
@@ -357,8 +356,7 @@ public class DynamoDBStore<K, T extends Persistent> extends WSDataStoreBase<K,
T
     } catch (InvocationTargetException e) {
       e.printStackTrace();
     } catch (GoraException ge){
-      LOG.error(ge.getMessage());
-      LOG.error(ge.getStackTrace().toString());
+      LOG.error(ge.getMessage(), ge);
     }
     return object;
   }

http://git-wip-us.apache.org/repos/asf/gora/blob/65d6c7ac/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java
----------------------------------------------------------------------
diff --git a/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java b/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java
index bc4b838..f8e82d0 100644
--- a/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java
+++ b/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java
@@ -121,8 +121,7 @@ implements Configurable {
         LOG.warn(DEPRECATED_MAPPING_FILE + " is deprecated, please rename the file to "
             + DEFAULT_MAPPING_FILE);
       } catch (FileNotFoundException ex1) {
-          LOG.error(ex1.getMessage());
-          LOG.error(ex1.getStackTrace().toString());
+          LOG.error(ex1.getMessage(), ex1);
           //throw (ex1); //throw the original exception
       } catch (Exception ex1) {
         LOG.warn(DEPRECATED_MAPPING_FILE + " is deprecated, please rename the file to "
@@ -151,8 +150,7 @@ implements Configurable {
       boolean autoflush = this.conf.getBoolean("hbase.client.autoflush.default", false);
       table = new HBaseTableConnection(getConf(), getSchemaName(), autoflush);
     } catch(IOException ex2){
-      LOG.error(ex2.getMessage());
-      LOG.error(ex2.getStackTrace().toString());
+      LOG.error(ex2.getMessage(), ex2);
     }
   }
 
@@ -176,8 +174,7 @@ implements Configurable {
   
       admin.createTable(tableDesc);
     } catch(IOException ex2){
-      LOG.error(ex2.getMessage());
-      LOG.error(ex2.getStackTrace().toString());
+      LOG.error(ex2.getMessage(), ex2);
     }
   }
 
@@ -190,8 +187,7 @@ implements Configurable {
       admin.disableTable(getSchemaName());
       admin.deleteTable(getSchemaName());
     } catch(IOException ex2){
-      LOG.error(ex2.getMessage());
-      LOG.error(ex2.getStackTrace().toString());
+      LOG.error(ex2.getMessage(), ex2);
     }
   }
 
@@ -200,8 +196,7 @@ implements Configurable {
     try{
       return admin.tableExists(mapping.getTableName());
     } catch(IOException ex2){
-      LOG.error(ex2.getMessage());
-      LOG.error(ex2.getStackTrace().toString());
+      LOG.error(ex2.getMessage(), ex2);
       return false;
     }
   }
@@ -215,8 +210,7 @@ implements Configurable {
       Result result = table.get(get);
       return newInstance(result, fields);      
     } catch(IOException ex2){
-      LOG.error(ex2.getMessage());
-      LOG.error(ex2.getStackTrace().toString());
+      LOG.error(ex2.getMessage(), ex2);
       return null;
     }
   }
@@ -265,8 +259,7 @@ implements Configurable {
         table.delete(delete); // HBase sometimes does not delete arbitrarily
       }
     } catch (IOException ex2) {
-      LOG.error(ex2.getMessage());
-      LOG.error(ex2.getStackTrace().toString());
+      LOG.error(ex2.getMessage(), ex2);
     }
   }
 
@@ -349,8 +342,7 @@ implements Configurable {
       //success is a bit costly
       return true;
     } catch(IOException ex2){
-      LOG.error(ex2.getMessage());
-      LOG.error(ex2.getStackTrace().toString());
+      LOG.error(ex2.getMessage(), ex2);
       return false;
     }
   }
@@ -376,8 +368,7 @@ implements Configurable {
       table.delete(deletes);
       return deletes.size();
     } catch (Exception ex) {
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
       return -1;
     }
   }
@@ -387,8 +378,7 @@ implements Configurable {
     try{
       table.flushCommits();
     }catch(IOException ex){
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
     }
   }
 
@@ -469,8 +459,7 @@ implements Configurable {
         return result;
       }
     }catch(IOException ex){
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
       return null;
     }
   }
@@ -799,12 +788,10 @@ implements Configurable {
           ((URLClassLoader) getClass().getClassLoader()).getURLs()));
       throw ex ;
     } catch(IOException ex) {
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
       throw ex;
     } catch(Exception ex) {
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
       throw new IOException(ex);
     }
 
@@ -816,8 +803,7 @@ implements Configurable {
     try{
       table.close();
     }catch(IOException ex){
-      LOG.error(ex.getMessage());
-      LOG.error(ex.getStackTrace().toString());
+      LOG.error(ex.getMessage(), ex);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/gora/blob/65d6c7ac/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java
----------------------------------------------------------------------
diff --git a/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java b/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java
index 37db1e8..a8c025b 100644
--- a/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java
+++ b/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java
@@ -162,8 +162,7 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K,
T>
           DEFAULT_MAPPING_FILE);
       mapping = readMapping(mappingFile);
     } catch (IOException e) {
-      LOG.error(e.getMessage());
-      LOG.error(e.getStackTrace().toString());
+      LOG.error(e.getMessage(), e);
     }
 
     solrServerUrl = DataStoreFactory.findProperty(properties, this,
@@ -301,7 +300,7 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K,
T>
         CoreAdminRequest.createCore(mapping.getCoreName(),
             mapping.getCoreName(), adminServer, solrConfig, solrSchema);
     } catch (Exception e) {
-      LOG.error(e.getMessage(), e.getStackTrace().toString());
+      LOG.error(e.getMessage(), e);
     }
   }
 
@@ -313,7 +312,7 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K,
T>
       server.commit();
     } catch (Exception e) {
       // ignore?
-      LOG.error(e.getMessage(), e.getStackTrace().toString());
+      LOG.error(e.getMessage(), e);
     }
   }
 
@@ -325,8 +324,7 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K,
T>
       server.commit();
     } catch (Exception e) {
       // ignore?
-      // LOG.error(e.getMessage());
-      // LOG.error(e.getStackTrace().toString());
+      // LOG.error(e.getMessage(), e);
     }
     try {
       CoreAdminRequest.unloadCore(mapping.getCoreName(), adminServer);
@@ -334,7 +332,7 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K,
T>
       if (e.getMessage().contains("No such core")) {
         return; // it's ok, the core is not there
       } else {
-        LOG.error(e.getMessage(), e.getStackTrace().toString());
+        LOG.error(e.getMessage(), e);
       }
     }
   }
@@ -347,7 +345,7 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K,
T>
           adminServer);
       exists = rsp.getUptime(mapping.getCoreName()) != null;
     } catch (Exception e) {
-      LOG.error(e.getMessage(), e.getStackTrace().toString());
+      LOG.error(e.getMessage(), e);
     }
     return exists;
   }
@@ -398,7 +396,7 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K,
T>
       }
       return newInstance((SolrDocument) o, fields);
     } catch (Exception e) {
-      LOG.error(e.getMessage(), e.getStackTrace().toString());
+      LOG.error(e.getMessage(), e);
     }
     return null;
   }
@@ -552,7 +550,7 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K,
T>
         add(batch, commitWithin);
         batch.clear();
       } catch (Exception e) {
-        LOG.error(e.getMessage(), e.getStackTrace().toString());
+        LOG.error(e.getMessage(), e);
       }
     }
   }
@@ -570,7 +568,7 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K,
T>
             fieldSchema);
         data = IOUtils.serialize(writer, fieldSchema, fieldValue);
       } catch (IOException e) {
-        LOG.error(e.getMessage(), e.getStackTrace().toString());
+        LOG.error(e.getMessage(), e);
       }
       fieldValue = data;
       break;
@@ -596,7 +594,7 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K,
T>
               String.valueOf(fieldSchema.hashCode()), fieldSchema);
           serilazeData = IOUtils.serialize(writer, fieldSchema, fieldValue);
         } catch (IOException e) {
-          LOG.error(e.getMessage(), e.getStackTrace().toString());
+          LOG.error(e.getMessage(), e);
         }
         fieldValue = serilazeData;
       }
@@ -668,7 +666,7 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K,
T>
       LOG.info(rsp.toString());
       return true;
     } catch (Exception e) {
-      LOG.error(e.getMessage(), e.getStackTrace().toString());
+      LOG.error(e.getMessage(), e);
     }
     return false;
   }
@@ -681,7 +679,7 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K,
T>
       server.commit();
       LOG.info(rsp.toString());
     } catch (Exception e) {
-      LOG.error(e.getMessage(), e.getStackTrace().toString());
+      LOG.error(e.getMessage(), e);
     }
     return 0;
   }
@@ -691,7 +689,7 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K,
T>
     try {
       return new SolrResult<K, T>(this, query, server, resultsSize);
     } catch (IOException e) {
-      LOG.error(e.getMessage(), e.getStackTrace().toString());
+      LOG.error(e.getMessage(), e);
     }
     return null;
   }
@@ -722,7 +720,7 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K,
T>
         batch.clear();
       }
     } catch (Exception e) {
-      LOG.error(e.getMessage(), e.getStackTrace());
+      LOG.error(e.getMessage(), e);
     }
   }
 


Mime
View raw message