diff options
author | Joseph O'Leary <joseph.o.leary@est.tech> | 2020-07-17 07:22:26 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-07-17 07:22:26 +0000 |
commit | 977a518c680032572f6c5c59879ead71221e460a (patch) | |
tree | 0324705b818ea29ba77a3e7ff06a5b11812527d2 | |
parent | 2af1b8c5a3481c569f799e7144d79de2f7db3400 (diff) | |
parent | a51d1c8c4ca61434d14008e0fbc3575a99ad1c74 (diff) |
Merge "Change log level for telemetry file from INFO to Debug"
-rw-r--r-- | src/main/java/org/onap/dcaegen2/services/pmmapper/utils/XMLValidator.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/org/onap/dcaegen2/services/pmmapper/utils/XMLValidator.java b/src/main/java/org/onap/dcaegen2/services/pmmapper/utils/XMLValidator.java index 9fa3e85..c6fa3fa 100644 --- a/src/main/java/org/onap/dcaegen2/services/pmmapper/utils/XMLValidator.java +++ b/src/main/java/org/onap/dcaegen2/services/pmmapper/utils/XMLValidator.java @@ -24,12 +24,10 @@ import java.nio.file.Files; import java.util.HashMap; import java.util.stream.Stream; import lombok.NonNull; -import org.onap.dcaegen2.services.pmmapper.mapping.Mapper; import org.onap.dcaegen2.services.pmmapper.model.Event; import org.onap.logging.ref.slf4j.ONAPLogAdapter; import org.slf4j.LoggerFactory; import org.xml.sax.SAXException; - import javax.xml.XMLConstants; import javax.xml.transform.stream.StreamSource; import javax.xml.validation.Schema; @@ -40,7 +38,7 @@ import java.io.StringReader; import java.nio.file.Path; public class XMLValidator { - private static final ONAPLogAdapter logger = new ONAPLogAdapter(LoggerFactory.getLogger(Mapper.class)); + private static final ONAPLogAdapter logger = new ONAPLogAdapter(LoggerFactory.getLogger(XMLValidator.class)); private HashMap<String, Schema> schemas; private SchemaFactory schemaFactory; public XMLValidator(Path schemaDirectory) { @@ -68,10 +66,11 @@ public class XMLValidator { try { Validator validator = schemas.get(event.getMetadata().getFileFormatType()).newValidator(); validator.validate(new StreamSource(new StringReader(event.getBody()))); - logger.unwrap().info("XML validation successful {}", event); + logger.unwrap().info("XML validation successful"); + logger.unwrap().debug(String.valueOf(event)); return true; } catch (SAXException | IOException exception) { - logger.unwrap().info("XML validation failed {}", event, exception); + logger.unwrap().error("XML validation failed {}", event, exception); return false; } } |