diff options
Diffstat (limited to 'aai-core/src/main/java/org/onap/aai/logging/EcompResponseDescription.java')
-rw-r--r-- | aai-core/src/main/java/org/onap/aai/logging/EcompResponseDescription.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/aai-core/src/main/java/org/onap/aai/logging/EcompResponseDescription.java b/aai-core/src/main/java/org/onap/aai/logging/EcompResponseDescription.java index 4b2b3b46..b72cc100 100644 --- a/aai-core/src/main/java/org/onap/aai/logging/EcompResponseDescription.java +++ b/aai-core/src/main/java/org/onap/aai/logging/EcompResponseDescription.java @@ -22,25 +22,26 @@ package org.onap.aai.logging; import ch.qos.logback.classic.pattern.ClassicConverter; import ch.qos.logback.classic.spi.ILoggingEvent; - import org.onap.aai.logging.LoggingContext.LoggingField; public class EcompResponseDescription extends ClassicConverter { - public final static String DefaultDescription = "Unknown response/error description"; + public static final String DEFAULT_DESCRIPTION = "Unknown response/error description"; @Override public String convert(ILoggingEvent event) { if (!event.getMDCPropertyMap().containsKey(LoggingField.RESPONSE_DESCRIPTION.toString())) { - return (DefaultDescription); + return (DEFAULT_DESCRIPTION); } // Replace pipes and new lines String currentDesc = event.getMDCPropertyMap().get(LoggingField.RESPONSE_DESCRIPTION.toString()); if ((currentDesc == null) || (currentDesc.length() == 0)) { - return (DefaultDescription); + return (DEFAULT_DESCRIPTION); } - currentDesc = currentDesc.replaceAll("|", "!"); + currentDesc = currentDesc.replaceAll("\\|", "!"); currentDesc = currentDesc.replaceAll("[\\r\\n]+", "^"); - return event.getMDCPropertyMap().get(LoggingField.RESPONSE_DESCRIPTION.toString()); + return event.getMDCPropertyMap().get(currentDesc); } } + + |