mirror of https://github.com/apache/lucene.git
SOLR-2124: do not log stack trace for Service Disabled / 503
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1302970 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
30f5ecb2f1
commit
255f763640
|
@ -690,7 +690,10 @@ Bug Fixes
|
||||||
package name (org.apache.commons.csv). This created a compatibility issue as
|
package name (org.apache.commons.csv). This created a compatibility issue as
|
||||||
the Apache Commons team works toward an official release of Commons CSV.
|
the Apache Commons team works toward an official release of Commons CSV.
|
||||||
JARJAR (http://code.google.com/p/jarjar/) was used to change the package name
|
JARJAR (http://code.google.com/p/jarjar/) was used to change the package name
|
||||||
to org.apache.solr.internal.csv. (Uwe Schindler, Emmanuel Bourg)
|
to org.apache.solr.internal.csv. (Uwe Schindler, Emmanuel Bourg)
|
||||||
|
|
||||||
|
* SOLR-2124: Do not log stack traces for "Service Disabled" / 503 Exceptions (PingRequestHandler, etc)
|
||||||
|
(James Dyer, others)
|
||||||
|
|
||||||
Other Changes
|
Other Changes
|
||||||
----------------------
|
----------------------
|
||||||
|
|
|
@ -75,6 +75,10 @@ public class SolrException extends RuntimeException {
|
||||||
|
|
||||||
public void log(Logger log) { log(log,this); }
|
public void log(Logger log) { log(log,this); }
|
||||||
public static void log(Logger log, Throwable e) {
|
public static void log(Logger log, Throwable e) {
|
||||||
|
if (e instanceof SolrException
|
||||||
|
&& ((SolrException) e).code() == ErrorCode.SERVICE_UNAVAILABLE.code) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
String stackTrace = toStr(e);
|
String stackTrace = toStr(e);
|
||||||
String ignore = doIgnore(e, stackTrace);
|
String ignore = doIgnore(e, stackTrace);
|
||||||
if (ignore != null) {
|
if (ignore != null) {
|
||||||
|
@ -86,6 +90,10 @@ public class SolrException extends RuntimeException {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void log(Logger log, String msg, Throwable e) {
|
public static void log(Logger log, String msg, Throwable e) {
|
||||||
|
if (e instanceof SolrException
|
||||||
|
&& ((SolrException) e).code() == ErrorCode.SERVICE_UNAVAILABLE.code) {
|
||||||
|
log(log, msg);
|
||||||
|
}
|
||||||
String stackTrace = msg + ':' + toStr(e);
|
String stackTrace = msg + ':' + toStr(e);
|
||||||
String ignore = doIgnore(e, stackTrace);
|
String ignore = doIgnore(e, stackTrace);
|
||||||
if (ignore != null) {
|
if (ignore != null) {
|
||||||
|
@ -109,7 +117,7 @@ public class SolrException extends RuntimeException {
|
||||||
@Override
|
@Override
|
||||||
public String toString() { return super.toString(); }
|
public String toString() { return super.toString(); }
|
||||||
|
|
||||||
public static String toStr(Throwable e) {
|
public static String toStr(Throwable e) {
|
||||||
CharArrayWriter cw = new CharArrayWriter();
|
CharArrayWriter cw = new CharArrayWriter();
|
||||||
PrintWriter pw = new PrintWriter(cw);
|
PrintWriter pw = new PrintWriter(cw);
|
||||||
e.printStackTrace(pw);
|
e.printStackTrace(pw);
|
||||||
|
|
Loading…
Reference in New Issue