Details
-
Enhancement
-
Resolution: Done
-
Minor
-
fuse-6.x-GA
-
None
-
%
-
7.0 Sprint 6
Description
Community Member requested this enhancement:
The logging in IDocUtil could be improved.
An Exception “Failed to set value” is logged in two positions in Code:
LOG.warn("Failed to set value", e);
It would be great for debugging purposes if the exactly field (and the value) is logged.
Example implementation witch I used during failure analysis:
public static void setIdocFieldValue(String fieldName, Segment segment, IDocSegment idocSegment)
{ … }catch (Exception e)
{ // LOG.warn("Failed to set value", e); logFailedToSetValue(fieldName, segment, idocSegment, e); }}
private static void logFailedToSetValue(String fieldName, Segment segment, IDocSegment idocSegment, Exception e) {
StringBuilder sb = new StringBuilder();
try
catch (Exception ex) {
} finally
//TODO: some information about the value itself would also be nice...
LOG.warn("BF-MODIFICATION: Failed to set value: " + sb.toString(), e);
}
This implementation leads to output:
BF-MODIFICATION: Failed to set value: WMCATO:WMCAID01.E2LTCAH001.SOLEX