Task #8111
Bug #8106: Difficulty Distinguishing Between Different Kinds of Failed Sync "Not Found" Error Messages
D1ResourceHandler.serializeException should not log all exceptions returned as errors.
100%
Description
Every DataONE exception is logged as a metacat ERROR, which is too high of a log level, and is distracting from log analysis when folks are searching for real system errors.
protected void serializeException(BaseException e, OutputStream out) {
// TODO: Use content negotiation to determine which return format to use
response.setContentType("text/xml");
response.setStatus(e.getCode());
logMetacat.error("D1ResourceHandler: Serializing exception with code " + e.getCode() + ": " + e.getMessage(), e);
the last line should be logMetacat.info(...), or warn, if we always want to be logging exceptions.
History
#1 Updated by Rob Nahf over 7 years ago
- Tracker changed from Bug to Task
#2 Updated by Chris Jones over 7 years ago
My vote would be to use WARN if it's making the logs difficult to read. However, doing so might also mask true errors at the REST level.
#3 Updated by Dave Vieglais over 7 years ago
- Target version set to CCI-2.3.6
#4 Updated by Jing Tao about 7 years ago
- Target version changed from CCI-2.3.6 to CCI-2.3.7
#5 Updated by Rob Nahf about 7 years ago
from maintenance meeting, the suggestion was to differentiate log levels by type of BaseException received, so for example, a NotFound might be an INFO or WARN (and not include a stacktrace) while a ServiceFailure which is really an unknown failure, might be better logged as an ERROR, including the stacktrace.
#6 Updated by Jing Tao about 7 years ago
- % Done changed from 0 to 100
- Status changed from New to Closed
Changed the code as the above comment from Rob.
#7 Updated by Dave Vieglais about 7 years ago
- Sprint set to CCI-2.3.7