mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-15 14:03:17 +00:00
Improve logging messages of SolrLogger service/listener. Debugging is otherwise impossible
This commit is contained in:
@@ -160,7 +160,7 @@ public class SolrLoggerServiceImpl implements SolrLoggerService, InitializingBea
|
|||||||
try {
|
try {
|
||||||
server = new HttpSolrServer(configurationService.getProperty("solr-statistics.server"));
|
server = new HttpSolrServer(configurationService.getProperty("solr-statistics.server"));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error("Error accessing Solr server configured in 'solr-statistics.server'", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
solr = server;
|
solr = server;
|
||||||
@@ -231,7 +231,8 @@ public class SolrLoggerServiceImpl implements SolrLoggerService, InitializingBea
|
|||||||
} catch (RuntimeException re) {
|
} catch (RuntimeException re) {
|
||||||
throw re;
|
throw re;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error("Error saving VIEW event to Solr for DSpaceObject {} by EPerson {}",
|
||||||
|
dspaceObject.getID(), currentUser.getEmail(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -266,7 +267,8 @@ public class SolrLoggerServiceImpl implements SolrLoggerService, InitializingBea
|
|||||||
} catch (RuntimeException re) {
|
} catch (RuntimeException re) {
|
||||||
throw re;
|
throw re;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error("Error saving VIEW event to Solr for DSpaceObject {} by EPerson {}",
|
||||||
|
dspaceObject.getID(), currentUser.getEmail(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,7 +340,7 @@ public class SolrLoggerServiceImpl implements SolrLoggerService, InitializingBea
|
|||||||
doc1.addField("longitude", longitude);
|
doc1.addField("longitude", longitude);
|
||||||
}
|
}
|
||||||
} catch (IOException | GeoIp2Exception e) {
|
} catch (IOException | GeoIp2Exception e) {
|
||||||
log.error("Unable to get location of request: {}", e.getMessage());
|
log.error("Unable to get location of request: {}", e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -473,7 +475,8 @@ public class SolrLoggerServiceImpl implements SolrLoggerService, InitializingBea
|
|||||||
} catch (RuntimeException re) {
|
} catch (RuntimeException re) {
|
||||||
throw re;
|
throw re;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error("Error saving SEARCH event to Solr by EPerson {}",
|
||||||
|
currentUser.getEmail(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -520,7 +523,7 @@ public class SolrLoggerServiceImpl implements SolrLoggerService, InitializingBea
|
|||||||
solr.add(solrDoc);
|
solr.add(solrDoc);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
//Log the exception, no need to send it through, the workflow shouldn't crash because of this !
|
//Log the exception, no need to send it through, the workflow shouldn't crash because of this !
|
||||||
log.error(e.getMessage(), e);
|
log.error("Error saving WORKFLOW event to Solr", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1033,7 +1036,7 @@ public class SolrLoggerServiceImpl implements SolrLoggerService, InitializingBea
|
|||||||
// solr.set
|
// solr.set
|
||||||
response = solr.query(solrQuery);
|
response = solr.query(solrQuery);
|
||||||
} catch (SolrServerException e) {
|
} catch (SolrServerException e) {
|
||||||
System.err.println("Error using query " + query);
|
log.error("Error searching Solr usage events using query {}", query, e);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
|
@@ -69,7 +69,7 @@ public class SolrLoggerUsageEventListener extends AbstractUsageEventListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.getMessage());
|
log.error("Error processing/logging UsageEvent {}", event.getName(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user