ExceptionHandler regurgitates long html pages into the wrapping ServiceFailure message, which goes into CN log files.
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.
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.
#1 Updated by Rob Nahf almost 5 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.