Story #8227
ExceptionHandler regurgitates long html pages into the wrapping ServiceFailure message, which goes into CN log files.
30%
Description
While useful to know what was returned in the error response when it was not the correct response, HTML pages can be verbose and include excessive markup that's not useful. Especially when a GMN MN is in debugging mode and there is a systematic error being returned (like during an authentication issue), these logged html pages can end up being 75% of the log files, and cause meaningful log lines from scrolling off the end of the log rotation.
An option should be provided to limit the amount of characters being returned in the ServiceFailure.
Options are to:
1. eliminate the message body altogether
2. truncate the message body
3. only print the visible parts of the HTML (remove and elements)
4. combination of 2 & 3
since a new feature, develop in trunk.
Associated revisions
refs #8227: added an HTML condenser for situations where the returned response is an exception written in HTML. Defined the configuration property: "dataone.execptionHandler.limitOriginalReponseInMessage", with a default to true.
refs #8227: added an HTML condenser for situations where the returned response is an exception written in HTML. Defined the configuration property: "dataone.execptionHandler.limitOriginalReponseInMessage", with a default to true.
History
#1 Updated by Rob Nahf almost 7 years ago
a Pattern-based routine has been established to limit the HTML to just printable characters and also removes blank lines. On a typical GMN debugging page for a NotFound, it reduced the length of the message body from 8200 characters to 2500, and only adds 7ms to the process.
Interestingly, adding a conditional to check a Settings property from the parsing routine (to see if it should be limited) costs 150ms, so it would be much more costly to allow on-the-fly changes to the way in which things are logged.
The choice of verbosity style is put in a static block, so a restart would be needed to change styles.
#2 Updated by Dave Vieglais almost 7 years ago
- Sprint set to Infrastructure backlog