[
https://issues.apache.org/jira/browse/DRILL-5056?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15727322#comment-15727322
]
ASF GitHub Bot commented on DRILL-5056:
---------------------------------------
Github user paul-rogers commented on a diff in the pull request:
https://github.com/apache/drill/pull/665#discussion_r91210473
--- Diff:
common/src/main/java/org/apache/drill/common/exceptions/UserException.java ---
@@ -549,7 +550,12 @@ public UserException build(final Logger logger) {
if (isSystemError) {
logger.error(newException.getMessage(), newException);
} else {
- logger.info("User Error Occurred", newException);
+ String msg = "User Error Occurred";
+ if (message != null) {
+ msg += ": " + message; }
+ if (cause != null) {
--- End diff --
The whole stack trace appears in the log. The item above is for those
"helpful" users go just do a grep based on the query ID and find just the lines
with the log header (including query ID.)
> UserException does not write full message to log
> ------------------------------------------------
>
> Key: DRILL-5056
> URL: https://issues.apache.org/jira/browse/DRILL-5056
> Project: Apache Drill
> Issue Type: Improvement
> Affects Versions: 1.8.0
> Reporter: Paul Rogers
> Assignee: Paul Rogers
> Priority: Minor
>
> A case occurred in which the External Sort failed during spilling. All that
> was written to the log was:
> {code}
> 2016-11-18 ... INFO o.a.d.e.p.i.xsort.ExternalSortBatch - User Error Occurred
> {code}
> As it turns out, there are two places in external sort that can throw a user
> exception. But, because the log contains neither line numbers nor detailed
> messages, it is not obvious which one was the cause.
> When logging a user error, include the text provided when building the error.
> For example, consider the following external sort code:
> {code}
> throw UserException.resourceError(e)
> .message("External Sort encountered an error while spilling to disk")
> .addContext(e.getMessage() /* more detail */)
> .build(logger);
> {code}
> The expected message is:
> {code}
> 2016-11-18 ... INFO o.a.d.e.p.i.xsort.ExternalSortBatch - User Error
> Occurred: External Sort encountered an error while spilling to disk (Disk
> write failed)
> {code}
> The part in parens is the cause of the error: the {{e.getMessage( )}} in the
> above code.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)