Duplicate logging frameworks merging 75/25675/5
authornoahs <noah.shogan@gmail.com>
Wed, 6 Dec 2017 11:11:38 +0000 (13:11 +0200)
committernoahs <noah.shogan@amdocs.com>
Wed, 6 Dec 2017 15:38:57 +0000 (17:38 +0200)
There was two copies of the SDC logging framework

Change-Id: I55c94c9817a83162c6d90e504dfd91e4858c7269
Issue-ID: SDC-703
Signed-off-by: noahs <noah.shogan@amdocs.com>
91 files changed:
common/openecomp-logging-lib/openecomp-logging-api/pom.xml [deleted file]
common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/BaseFactory.java [deleted file]
common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/Logger.java [deleted file]
common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/LoggerCreationService.java [deleted file]
common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/LoggerFactory.java [deleted file]
common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/annotations/Metrics.java [deleted file]
common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/context/ContextPropagationService.java [deleted file]
common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/context/TaskFactory.java [deleted file]
common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/Markers.java [deleted file]
common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/Slf4JLoggerCreationService.java [deleted file]
common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/aspects/MetricsAspect.java [deleted file]
common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/context/MdcPropagationService.java [deleted file]
common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/logback/DispatchingAppender.java [deleted file]
common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/logback/EventTypeDiscriminator.java [deleted file]
common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/servlet/LoggingFilter.java [deleted file]
common/openecomp-logging-lib/openecomp-logging-core/src/main/resources/META-INF/services/org.openecomp.core.logging.api.LoggerCreationService [deleted file]
common/openecomp-logging-lib/openecomp-logging-core/src/main/resources/META-INF/services/org.openecomp.core.logging.api.context.ContextPropagationService [deleted file]
common/openecomp-logging-lib/pom.xml [deleted file]
common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/pom.xml
common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/service/ArtifactGenerationService.java
common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-core/pom.xml
common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-core/src/main/java/org/openecomp/sdc/generator/GeneratorManager.java
common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-core/src/main/java/org/openecomp/sdc/generator/GeneratorTask.java
common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-core/src/main/java/org/openecomp/sdc/generator/aai/AaiArtifactGenerator.java
common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-core/src/main/java/org/openecomp/sdc/generator/aai/AaiModelGeneratorImpl.java
common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-core/src/main/java/org/openecomp/sdc/generator/aspect/AuditAspect.java
common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-core/src/main/java/org/openecomp/sdc/generator/aspect/MetricsAspect.java
common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-core/src/main/java/org/openecomp/sdc/generator/impl/ArtifactGenerationServiceImpl.java
common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-core/src/main/java/org/openecomp/sdc/generator/util/ArtifactGeneratorUtil.java
common/pom.xml
common/readMe.txt
openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/beans-services.xml
openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/pom.xml
openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/pom.xml
openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/util/TestUtil.java
openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/pom.xml [deleted file]
openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/annotations/Debug.java [deleted file]
openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/resources/logback.xml [deleted file]
openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/pom.xml [deleted file]
openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/aspects/DebugAspect.java [deleted file]
openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/method/LoggingInvocationHandler.java [deleted file]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/pom.xml [new file with mode: 0644]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/BaseFactory.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/BaseFactory.java with 96% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/Logger.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/Logger.java with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/LoggerCreationService.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/LoggerCreationService.java with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/LoggerFactory.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/LoggerFactory.java with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/annotations/Metrics.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/annotations/Metrics.java with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/context/ContextPropagationService.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/context/ContextPropagationService.java with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/context/TaskFactory.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/context/TaskFactory.java with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/context/MdcData.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/context/MdcData.java with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/messages/AuditMessages.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/messages/AuditMessages.java with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/messages/DebugMessages.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/messages/DebugMessages.java with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/types/DebugConstants.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/types/DebugConstants.java with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/types/LoggerConstants.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/types/LoggerConstants.java with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/types/LoggerErrorCategory.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/types/LoggerErrorCategory.java with 99% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/types/LoggerErrorCode.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/types/LoggerErrorCode.java with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/types/LoggerErrorDescription.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/types/LoggerErrorDescription.java with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/types/LoggerServiceName.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/types/LoggerServiceName.java with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/types/LoggerTragetServiceName.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/types/LoggerTragetServiceName.java with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/resources/factoryConfiguration.json [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/resources/factoryConfiguration.json with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/api/LoggerFactoryTest.java [moved from common/openecomp-logging-lib/openecomp-logging-api/src/test/java/org/openecomp/core/logging/api/LoggerFactoryTest.java with 88% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/api/context/TaskFactoryTest.java [moved from common/openecomp-logging-lib/openecomp-logging-api/src/test/java/org/openecomp/core/logging/api/context/TaskFactoryTest.java with 93% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/README [moved from common/openecomp-logging-lib/openecomp-logging-core/README with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/pom.xml [moved from common/openecomp-logging-lib/openecomp-logging-core/pom.xml with 69% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/Markers.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/Markers.java with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/SLF4JLoggerCreationService.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/SLF4JLoggerCreationService.java with 96% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/aspects/MetricsAspect.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/aspects/MetricsAspect.java with 88% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/context/MDCPropagationService.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/context/MDCPropagationService.java with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/context/MdcUtil.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/context/MdcUtil.java with 98% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/context/impl/MdcDataDebugMessage.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/context/impl/MdcDataDebugMessage.java with 95% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/context/impl/MdcDataErrorMessage.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/context/impl/MdcDataErrorMessage.java with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/logback/DispatchingAppender.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/logback/DispatchingAppender.java with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/logback/EventTypeDiscriminator.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/logback/EventTypeDiscriminator.java with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/servlet/LoggingFilter.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/servlet/LoggingFilter.java with 94% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/util/LoggingUtils.java [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/util/LoggingUtils.java with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/main/resources/META-INF/services/org.openecomp.sdc.logging.api.LoggerCreationService [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/resources/META-INF/services/org.openecomp.sdc.logging.api.LoggerCreationService with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/main/resources/META-INF/services/org.openecomp.sdc.logging.api.context.ContextPropagationService [moved from openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/resources/META-INF/services/org.openecomp.sdc.logging.api.context.ContextPropagationService with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/LoggerFactoryTest.java [moved from common/openecomp-logging-lib/openecomp-logging-core/src/test/java/org/openecomp/core/logging/LoggerFactoryTest.java with 77% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/RoutingTest.java [moved from common/openecomp-logging-lib/openecomp-logging-core/src/test/java/org/openecomp/core/logging/RoutingTest.java with 98% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/api/LoggerTest.java [moved from common/openecomp-logging-lib/openecomp-logging-core/src/test/java/org/openecomp/core/logging/api/LoggerTest.java with 98% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/aspects/MetricsAspectTest.java [moved from common/openecomp-logging-lib/openecomp-logging-core/src/test/java/org/openecomp/core/logging/aspects/MetricsAspectTest.java with 82% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/context/MDCPropagationFactoryTest.java [moved from common/openecomp-logging-lib/openecomp-logging-core/src/test/java/org/openecomp/core/logging/context/MDCPropagationFactoryTest.java with 57% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/context/TaskFactoryTest.java [moved from common/openecomp-logging-lib/openecomp-logging-core/src/test/java/org/openecomp/core/logging/context/TaskFactoryTest.java with 75% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/logback/EventTypeDiscriminatorTest.java [moved from common/openecomp-logging-lib/openecomp-logging-core/src/test/java/org/openecomp/core/logging/logback/EventTypeDiscriminatorTest.java with 98% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/servlet/LoggingFilterTest.java [moved from common/openecomp-logging-lib/openecomp-logging-core/src/test/java/org/openecomp/core/logging/servlet/LoggingFilterTest.java with 98% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/resources/README [moved from common/openecomp-logging-lib/openecomp-logging-core/src/test/resources/README with 100% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/resources/dispatching-logback.xml [moved from common/openecomp-logging-lib/openecomp-logging-core/src/test/resources/dispatching-logback.xml with 98% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/resources/logback-test.xml [moved from common/openecomp-logging-lib/openecomp-logging-core/src/test/resources/logback.xml with 94% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/resources/sifting-logback.xml [moved from common/openecomp-logging-lib/openecomp-logging-core/src/test/resources/sifting-logback.xml with 94% similarity]
openecomp-be/lib/openecomp-sdc-logging-lib/pom.xml [moved from openecomp-be/lib/openecomp-logging-lib/pom.xml with 65% similarity]
openecomp-be/lib/pom.xml

diff --git a/common/openecomp-logging-lib/openecomp-logging-api/pom.xml b/common/openecomp-logging-lib/openecomp-logging-api/pom.xml
deleted file mode 100644 (file)
index 62fe5c5..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <name>openecomp-configuration-management-test</name>
-    <groupId>org.openecomp.sdc.common</groupId>
-    <artifactId>openecomp-logging-api</artifactId>
-
-    <parent>
-        <artifactId>openecomp-logging-lib</artifactId>
-        <groupId>org.openecomp.sdc.common</groupId>
-        <version>1.2.0-SNAPSHOT</version>
-        <relativePath>..</relativePath>
-    </parent>
-
-</project>
diff --git a/common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/BaseFactory.java b/common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/BaseFactory.java
deleted file mode 100644 (file)
index 1494380..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.core.logging.api;
-
-import java.util.Iterator;
-import java.util.ServiceLoader;
-
-/**
- * Contains common functionality for factories used in the logging framework. <p>In order to use the
- * factory, a particular (e.g. framework-specific) implementation of a service must be configured as
- * described in <a href="http://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html">java.util.ServiceLoader</a>).</p>
- *
- * @see java.util.ServiceLoader
- */
-public class BaseFactory {
-
-  protected static <T> T locateService(Class<T> clazz) throws Exception {
-
-    T service;
-    ServiceLoader<T> loader = ServiceLoader.load(clazz);
-    Iterator<T> iterator = loader.iterator();
-    if (iterator.hasNext()) {
-
-      service = iterator.next();
-      if (iterator.hasNext()) {
-        System.err.println(String.format("Warning! Configured more than one implementation of %s",
-            clazz.getName()));
-      }
-
-      return service;
-    }
-
-    throw new IllegalArgumentException(
-        (String.format("No implementations configured for %s", clazz.getName())));
-  }
-}
diff --git a/common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/Logger.java b/common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/Logger.java
deleted file mode 100644 (file)
index 0fe3d8f..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.core.logging.api;
-
-/**
- * <p>This interface defines logging as specified by OPENECOMP logging requirements.</p> <p>Formatted
- * messages must follow the <a href="http://www.slf4j.org/api/org/slf4j/helpers/MessageFormatter.html>SLF4J
- * format</a>.</p>
- */
-public interface Logger {
-
-  String getName();
-
-  boolean isMetricsEnabled();
-
-  void metrics(String msg);
-
-  void metrics(String msg, Object arg);
-
-  void metrics(String msg, Object arg1, Object arg2);
-
-  void metrics(String msg, Object... arguments);
-
-  void metrics(String msg, Throwable throwable);
-
-  boolean isAuditEnabled();
-
-  void audit(String msg);
-
-  void audit(String msg, Object arg);
-
-  void audit(String msg, Object arg1, Object arg2);
-
-  void audit(String msg, Object... arguments);
-
-  void audit(String msg, Throwable throwable);
-
-  boolean isDebugEnabled();
-
-  void debug(String msg);
-
-  void debug(String msg, Object arg);
-
-  void debug(String msg, Object arg1, Object arg2);
-
-  void debug(String msg, Object... arguments);
-
-  void debug(String msg, Throwable throwable);
-
-  boolean isInfoEnabled();
-
-  void info(String msg);
-
-  void info(String msg, Object arg);
-
-  void info(String msg, Object arg1, Object arg2);
-
-  void info(String msg, Object... arguments);
-
-  void info(String msg, Throwable throwable);
-
-  boolean isWarnEnabled();
-
-  void warn(String msg);
-
-  void warn(String msg, Object arg);
-
-  void warn(String msg, Object... arguments);
-
-  void warn(String msg, Object arg1, Object arg2);
-
-  void warn(String msg, Throwable throwable);
-
-  boolean isErrorEnabled();
-
-  void error(String msg);
-
-  void error(String msg, Object arg);
-
-  void error(String msg, Object arg1, Object arg2);
-
-  void error(String msg, Object... arguments);
-
-  void error(String msg, Throwable throwable);
-}
diff --git a/common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/LoggerCreationService.java b/common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/LoggerCreationService.java
deleted file mode 100644 (file)
index 298f8f0..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.openecomp.core.logging.api;
-
-/**
- * Implements a framework-specific logging, to be used by {@link LoggerFactory}.
- */
-public interface LoggerCreationService {
-
-  Logger getLogger(String className);
-
-  Logger getLogger(Class<?> clazz);
-}
diff --git a/common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/LoggerFactory.java b/common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/LoggerFactory.java
deleted file mode 100644 (file)
index fdc874e..0000000
+++ /dev/null
@@ -1,232 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.core.logging.api;
-
-/**
- * <a>Factory to hide a concrete, framework-specific implementation of logger creation.</a> <p>The
- * service used by this factory must implement {@link LoggerCreationService}. If no implementation
- * has been configured or could not be instantiated, a <b>no-op logger</b> will be used, and <b>no
- * events</b> will be logged. This is done to prevent recursion if attempts are being made to log
- * exceptions that resulted from logger initialization. </p>
- *
- * @see BaseFactory
- * @see LoggerCreationService
- */
-@SuppressWarnings("ThrowableInstanceNeverThrown")
-public class LoggerFactory extends BaseFactory {
-
-  private static final LoggerCreationService SERVICE;
-
-  static {
-
-    LoggerCreationService service;
-
-    try {
-      service = locateService(LoggerCreationService.class);
-    } catch (Exception e) {
-      new RuntimeException("Failed to instantiate logger factory", e).printStackTrace();
-      // use the no-op service to prevent recursion in case of an attempt to log an exception as a
-      // result of a logger initialization error
-      service = new NoOpLoggerCreationService();
-    }
-
-    SERVICE = service;
-  }
-
-  public static Logger getLogger(String clazzName) {
-    return SERVICE.getLogger(clazzName);
-  }
-
-  public static Logger getLogger(Class<?> clazz) {
-    return SERVICE.getLogger(clazz);
-  }
-
-  private static class NoOpLoggerCreationService implements LoggerCreationService {
-
-    private static final Logger NO_OP_LOGGER = new Logger() {
-
-      @Override
-      public String getName() {
-        return "No-Op Logger";
-      }
-
-      @Override
-      public boolean isMetricsEnabled() {
-        return false;
-      }
-
-      @Override
-      public void metrics(String msg) {
-      }
-
-      @Override
-      public void metrics(String msg, Object arg) {
-      }
-
-      @Override
-      public void metrics(String msg, Object arg1, Object arg2) {
-      }
-
-      @Override
-      public void metrics(String msg, Object... arguments) {
-      }
-
-      @Override
-      public void metrics(String msg, Throwable throwable) {
-      }
-
-      @Override
-      public boolean isAuditEnabled() {
-        return false;
-      }
-
-      @Override
-      public void audit(String msg) {
-      }
-
-      @Override
-      public void audit(String msg, Object arg) {
-      }
-
-      @Override
-      public void audit(String msg, Object arg1, Object arg2) {
-      }
-
-      @Override
-      public void audit(String msg, Object... arguments) {
-      }
-
-      @Override
-      public void audit(String msg, Throwable throwable) {
-      }
-
-      @Override
-      public boolean isDebugEnabled() {
-        return false;
-      }
-
-      @Override
-      public void debug(String msg) {
-      }
-
-      @Override
-      public void debug(String msg, Object arg) {
-      }
-
-      @Override
-      public void debug(String msg, Object arg1, Object arg2) {
-      }
-
-      @Override
-      public void debug(String msg, Object... arguments) {
-      }
-
-      @Override
-      public void debug(String msg, Throwable throwable) {
-      }
-
-      @Override
-      public boolean isInfoEnabled() {
-        return false;
-      }
-
-      @Override
-      public void info(String msg) {
-      }
-
-      @Override
-      public void info(String msg, Object arg) {
-      }
-
-      @Override
-      public void info(String msg, Object arg1, Object arg2) {
-      }
-
-      @Override
-      public void info(String msg, Object... arguments) {
-      }
-
-      @Override
-      public void info(String msg, Throwable throwable) {
-      }
-
-      @Override
-      public boolean isWarnEnabled() {
-        return false;
-      }
-
-      @Override
-      public void warn(String msg) {
-      }
-
-      @Override
-      public void warn(String msg, Object arg) {
-      }
-
-      @Override
-      public void warn(String msg, Object... arguments) {
-      }
-
-      @Override
-      public void warn(String msg, Object arg1, Object arg2) {
-      }
-
-      @Override
-      public void warn(String msg, Throwable throwable) {
-      }
-
-      @Override
-      public boolean isErrorEnabled() {
-        return false;
-      }
-
-      @Override
-      public void error(String msg) {
-      }
-
-      @Override
-      public void error(String msg, Object arg) {
-      }
-
-      @Override
-      public void error(String msg, Object arg1, Object arg2) {
-      }
-
-      @Override
-      public void error(String msg, Object... arguments) {
-      }
-
-      @Override
-      public void error(String msg, Throwable throwable) {
-      }
-    };
-
-    @Override
-    public Logger getLogger(String className) {
-      return NO_OP_LOGGER;
-    }
-
-    @Override
-    public Logger getLogger(Class<?> clazz) {
-      return NO_OP_LOGGER;
-    }
-  }
-}
diff --git a/common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/annotations/Metrics.java b/common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/annotations/Metrics.java
deleted file mode 100644 (file)
index 1588bca..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.openecomp.core.logging.api.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Indicates a method whose execution time should be measured and logged as required for OPENECOMP
- * metrics.
- */
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Metrics {
-}
diff --git a/common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/context/ContextPropagationService.java b/common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/context/ContextPropagationService.java
deleted file mode 100644 (file)
index 8e9c2df..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.openecomp.core.logging.api.context;
-
-/**
- * Should be used to implement a framework-specific mechanism of propagation of a diagnostic context
- * to child threads.
- */
-public interface ContextPropagationService {
-
-  Runnable create(Runnable task);
-}
diff --git a/common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/context/TaskFactory.java b/common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/context/TaskFactory.java
deleted file mode 100644 (file)
index 30bc737..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.core.logging.api.context;
-
-import org.openecomp.core.logging.api.BaseFactory;
-
-/**
- * <p>Should be used to propagate a diagnostic context (for instance <a
- * href="http://www.slf4j.org/manual.html#mdc">MDC</a>) to other threads.</p> <p>Applicable when
- * creating a child thread directly, or submitting tasks for potentially postponed execution via an
- * <a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executor.html">Executor</a>
- * (including any of the <a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html">executor
- * services</a> and <a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ForkJoinPool.html">ForkJoinPool</a>).</p>
- * <p>The service used by this factory must implement {@link ContextPropagationService}.</p>
- *
- * @see ContextPropagationService
- */
-@SuppressWarnings("ThrowableInstanceNeverThrown")
-public class TaskFactory extends BaseFactory {
-
-  private static final ContextPropagationService SERVICE;
-  private static final RuntimeException ERROR;
-
-  static {
-
-    ContextPropagationService service = null;
-    RuntimeException error = null;
-
-    try {
-      service = locateService(ContextPropagationService.class);
-    } catch (Exception e) {
-      error = new RuntimeException("Failed to instantiate task factory", e);
-    }
-
-    SERVICE = service;
-    ERROR = error;
-  }
-
-  /**
-   * Modify a task so that a diagnostic context is propagated to the thread when the task runs. Done
-   * in a logging-framework specific way.
-   *
-   * @param task any Runnable that will run in a thread
-   * @return modified (wrapped) original task that runs the same business logic, but also takes care
-   of copying the diagnostic context for logging.
-   */
-  public static Runnable create(Runnable task) {
-
-    if (SERVICE == null) {
-      throw ERROR;
-    }
-
-    return SERVICE.create(task);
-  }
-}
diff --git a/common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/Markers.java b/common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/Markers.java
deleted file mode 100644 (file)
index dc2ae36..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.openecomp.core.logging;
-
-import org.slf4j.Marker;
-import org.slf4j.MarkerFactory;
-
-/**
- * <p>The list of markers that can be used for special logging such as metrics, audit, etc.</p>
- * <p>Although markers can be easily instantiated whenever needed, having constants for them helps
- * eliminate mistakes - misspelling, using a marker that is not handled, etc.</p> <p>Usage:</p>
- * <pre>
- *     Logger log = LogFactory.getLogger(this.getClass());
- *     log.info(Markers.AUDIT, "User '{}' logged out", user);
- * </pre>
- *
- * @see org.slf4j.Marker
- */
-public class Markers {
-
-  public static final Marker AUDIT = MarkerFactory.getMarker("AUDIT");
-  public static final Marker METRICS = MarkerFactory.getMarker("METRICS");
-}
diff --git a/common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/Slf4JLoggerCreationService.java b/common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/Slf4JLoggerCreationService.java
deleted file mode 100644 (file)
index 3238e75..0000000
+++ /dev/null
@@ -1,236 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.core.logging;
-
-import org.openecomp.core.logging.api.Logger;
-import org.openecomp.core.logging.api.LoggerCreationService;
-import org.slf4j.LoggerFactory;
-
-public class Slf4JLoggerCreationService implements LoggerCreationService {
-
-  @Override
-  public Logger getLogger(String className) {
-    return new Slf4JWrapper(className);
-  }
-
-  @Override
-  public Logger getLogger(Class<?> clazz) {
-    return new Slf4JWrapper(clazz);
-  }
-
-  private class Slf4JWrapper implements Logger {
-
-    private final org.slf4j.Logger logger;
-
-    public Slf4JWrapper(Class<?> clazz) {
-      logger = LoggerFactory.getLogger(clazz);
-    }
-
-    public Slf4JWrapper(String className) {
-      logger = LoggerFactory.getLogger(className);
-    }
-
-    @Override
-    public String getName() {
-      return logger.getName();
-    }
-
-    @Override
-    public boolean isMetricsEnabled() {
-      return logger.isInfoEnabled(Markers.METRICS);
-    }
-
-    @Override
-    public void metrics(String msg) {
-      logger.info(Markers.METRICS, msg);
-    }
-
-    @Override
-    public void metrics(String msg, Object arg) {
-      logger.info(Markers.METRICS, msg, arg);
-    }
-
-    @Override
-    public void metrics(String msg, Object arg1, Object arg2) {
-      logger.info(Markers.METRICS, msg, arg1, arg2);
-    }
-
-    @Override
-    public void metrics(String msg, Object... arguments) {
-      logger.info(Markers.METRICS, msg, arguments);
-    }
-
-    @Override
-    public void metrics(String msg, Throwable throwable) {
-      logger.info(Markers.METRICS, msg, throwable);
-    }
-
-    @Override
-    public boolean isAuditEnabled() {
-      return logger.isInfoEnabled(Markers.AUDIT);
-    }
-
-    @Override
-    public void audit(String msg) {
-      logger.info(Markers.AUDIT, msg);
-    }
-
-    @Override
-    public void audit(String msg, Object arg) {
-      logger.info(Markers.AUDIT, msg, arg);
-    }
-
-    @Override
-    public void audit(String msg, Object arg1, Object arg2) {
-      logger.info(Markers.AUDIT, msg, arg1, arg2);
-    }
-
-    @Override
-    public void audit(String msg, Object... arguments) {
-      logger.info(Markers.AUDIT, msg, arguments);
-    }
-
-    @Override
-    public void audit(String msg, Throwable throwable) {
-      logger.info(Markers.AUDIT, msg, throwable);
-    }
-
-    @Override
-    public boolean isDebugEnabled() {
-      return logger.isDebugEnabled();
-    }
-
-    @Override
-    public void debug(String msg) {
-      logger.debug(msg);
-    }
-
-    @Override
-    public void debug(String format, Object arg) {
-      logger.debug(format, arg);
-    }
-
-    @Override
-    public void debug(String format, Object arg1, Object arg2) {
-      logger.debug(format, arg1, arg2);
-    }
-
-    @Override
-    public void debug(String format, Object... arguments) {
-      logger.debug(format, arguments);
-    }
-
-    @Override
-    public void debug(String msg, Throwable throwable) {
-      logger.debug(msg, throwable);
-    }
-
-    @Override
-    public boolean isInfoEnabled() {
-      return logger.isInfoEnabled();
-    }
-
-    @Override
-    public void info(String msg) {
-      logger.info(msg);
-    }
-
-    @Override
-    public void info(String format, Object arg) {
-      logger.info(format, arg);
-    }
-
-    @Override
-    public void info(String format, Object arg1, Object arg2) {
-      logger.info(format, arg1, arg2);
-    }
-
-    @Override
-    public void info(String format, Object... arguments) {
-      logger.info(format, arguments);
-    }
-
-    @Override
-    public void info(String msg, Throwable throwable) {
-      logger.info(msg, throwable);
-    }
-
-    @Override
-    public boolean isWarnEnabled() {
-      return logger.isWarnEnabled();
-    }
-
-    @Override
-    public void warn(String msg) {
-      logger.warn(msg);
-    }
-
-    @Override
-    public void warn(String format, Object arg) {
-      logger.warn(format, arg);
-    }
-
-    @Override
-    public void warn(String format, Object... arguments) {
-      logger.warn(format, arguments);
-    }
-
-    @Override
-    public void warn(String format, Object arg1, Object arg2) {
-      logger.warn(format, arg1, arg2);
-    }
-
-    @Override
-    public void warn(String msg, Throwable throwable) {
-      logger.warn(msg, throwable);
-    }
-
-    @Override
-    public boolean isErrorEnabled() {
-      return logger.isErrorEnabled();
-    }
-
-    @Override
-    public void error(String msg) {
-      logger.error(msg);
-    }
-
-    @Override
-    public void error(String format, Object arg) {
-      logger.error(format, arg);
-    }
-
-    @Override
-    public void error(String format, Object arg1, Object arg2) {
-      logger.error(format, arg1, arg2);
-    }
-
-    @Override
-    public void error(String format, Object... arguments) {
-      logger.error(format, arguments);
-    }
-
-    @Override
-    public void error(String msg, Throwable throwable) {
-      logger.error(msg, throwable);
-    }
-  }
-}
diff --git a/common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/aspects/MetricsAspect.java b/common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/aspects/MetricsAspect.java
deleted file mode 100644 (file)
index 9e8c7f0..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.core.logging.aspects;
-
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.openecomp.core.logging.api.Logger;
-import org.openecomp.core.logging.api.LoggerFactory;
-import org.openecomp.core.logging.api.annotations.Metrics;
-
-/**
- * <p>Wraps around any method annotated with {@link Metrics} to measure and log its execution time
- * in milliseconds.</p> <p>In order for the aspect to be used, AspectJ annotation processing must be
- * tuned on and this particular aspect enabled. Conversely, it can be disabled completely if the
- * application does not need to log metrics.</p> <p>See, for example, <a
- * href="http://docs.spring.io/spring/docs/current/spring-framework-reference/html/aop.html"> Aspect
- * Oriented Programming with Spring</a>.</p>
- *
- * @see Metrics
- */
-@Aspect
-public class MetricsAspect {
-
-  private static final String MESSAGE_TEMPLATE = "'{}' took {} milliseconds";
-
-  /**
-   * Log execution time object.
-   *
-   * @param pjp the pjp
-   * @return the object
-   * @throws Throwable the throwable
-   */
-  @Around("@annotation(org.openecomp.core.logging.api.annotations.Metrics)")
-  public Object logExecutionTime(ProceedingJoinPoint pjp) throws Throwable {
-
-    final Logger logger = LoggerFactory.getLogger(pjp.getSignature().getDeclaringTypeName());
-    // measure and log only if the logger for this class is enabled
-    if (logger.isMetricsEnabled()) {
-
-      final String method = pjp.getSignature().getName();
-      final long start = System.currentTimeMillis();
-
-      try {
-        return pjp.proceed();
-      } finally {
-        logger.metrics(MESSAGE_TEMPLATE, method, System.currentTimeMillis() - start);
-      }
-
-    } else {
-      return pjp.proceed();
-    }
-  }
-}
diff --git a/common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/context/MdcPropagationService.java b/common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/context/MdcPropagationService.java
deleted file mode 100644 (file)
index 94ad1b9..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.core.logging.context;
-
-import org.openecomp.core.logging.api.context.ContextPropagationService;
-import org.slf4j.MDC;
-
-import java.util.Map;
-
-/**
- * Propagates the <a href="http://www.slf4j.org/manual.html#mdc">SLF4J Mapped Diagnostic Context
- * (MDC)</a> of a thread onto a runnable created by that thread, so that the context is available
- * when the runnable is executed in a new thread.
- */
-public class MdcPropagationService implements ContextPropagationService {
-
-  public Runnable create(Runnable task) {
-    return new MdcCopyingWrapper(task);
-  }
-
-  private static class MdcCopyingWrapper implements Runnable {
-
-    private final Runnable task;
-    private final Map<String, String> context;
-
-    private MdcCopyingWrapper(Runnable task) {
-      this.task = task;
-      this.context = MDC.getCopyOfContextMap();
-    }
-
-    private static void replaceMdc(Map<String, String> context) {
-
-      if (context == null) {
-        MDC.clear();
-      } else {
-        MDC.setContextMap(context);
-      }
-    }
-
-    @Override
-    public void run() {
-
-      Map<String, String> oldContext = MDC.getCopyOfContextMap();
-      replaceMdc(this.context);
-
-      try {
-        task.run();
-      } finally {
-        replaceMdc(oldContext);
-      }
-    }
-  }
-}
diff --git a/common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/logback/DispatchingAppender.java b/common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/logback/DispatchingAppender.java
deleted file mode 100644 (file)
index 6d5642e..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.core.logging.logback;
-
-import ch.qos.logback.classic.Logger;
-import ch.qos.logback.classic.LoggerContext;
-import ch.qos.logback.classic.sift.MDCBasedDiscriminator;
-import ch.qos.logback.classic.spi.ILoggingEvent;
-import ch.qos.logback.core.Appender;
-import ch.qos.logback.core.AppenderBase;
-import ch.qos.logback.core.joran.spi.DefaultClass;
-import ch.qos.logback.core.sift.Discriminator;
-import org.slf4j.LoggerFactory;
-
-import java.util.Iterator;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * <p>Allows to use EELF logging configuration almost as is, by using a custom routing function, but
- * pre-configured appenders attached to the standard EELF loggers.</p> <p>Changes that must be made
- * in <i>logback.xml</i> supplied with EELF:</p>
- * <pre>
- *     &lt;appender name="DISPATCHER" class="DispatchingAppender"&gt;
- *          &lt;discriminator class="EventTypeDiscriminator"/&gt;
- *          &lt;appenderNamePattern&gt;asyncEELF%s&lt;/appenderNamePattern&gt;
- *     &lt;/appender&gt;
- *     &lt;root level="INFO" additivity="false"&gt;
- *          &lt;appender-ref ref="DISPATCHER" /&gt;
- *      &lt;/root&gt;
- * </pre>
- */
-public class DispatchingAppender extends AppenderBase<ILoggingEvent> {
-
-  // "magic" appender to indicate a missing appender
-  private static final Appender<ILoggingEvent> NO_APPENDER = new DispatchingAppender();
-
-  private Map<String, Appender<ILoggingEvent>> appenders = new ConcurrentHashMap<>();
-
-  private Discriminator<ILoggingEvent> discriminator;
-  private String appenderNamePattern;
-
-  public Discriminator<ILoggingEvent> getDiscriminator() {
-    return this.discriminator;
-  }
-
-  @DefaultClass(MDCBasedDiscriminator.class)
-  public void setDiscriminator(Discriminator<ILoggingEvent> discriminator) {
-    this.discriminator = discriminator;
-  }
-
-  public String getAppenderNamePattern() {
-    return this.appenderNamePattern;
-  }
-
-  public void setAppenderNamePattern(String pattern) {
-    this.appenderNamePattern = pattern;
-  }
-
-  @Override
-  protected void append(ILoggingEvent event) {
-
-    if (this.isStarted()) {
-
-      String discriminatingValue = this.discriminator.getDiscriminatingValue(event);
-      String appenderName = String.format(this.appenderNamePattern, discriminatingValue);
-      Appender<ILoggingEvent> appender = this.lookupAppender(appenderName);
-      if (appender == NO_APPENDER) {
-        this.addError(String.format("Appender %s does not exist", appenderName));
-      } else {
-        appender.doAppend(event);
-      }
-    }
-  }
-
-  private Appender<ILoggingEvent> lookupAppender(String key) {
-
-    Appender<ILoggingEvent> appender = appenders.get(key);
-    if (appender != null) {
-      return appender;
-    }
-
-    LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
-    for (Logger log : context.getLoggerList()) {
-
-      Iterator<Appender<ILoggingEvent>> iterator = log.iteratorForAppenders();
-      while (iterator.hasNext()) {
-
-        Appender<ILoggingEvent> element = iterator.next();
-        if (key.equals(element.getName())) {
-          this.appenders.putIfAbsent(key, element);
-          return element;
-        }
-      }
-    }
-
-    // to avoid consecutive lookups if the required appender does not exist
-    this.appenders.putIfAbsent(key, NO_APPENDER);
-    return NO_APPENDER;
-  }
-
-  @Override
-  public void start() {
-
-    int errors = 0;
-    if (this.discriminator == null) {
-      this.addError("Missing discriminator. Aborting");
-    }
-
-    if (!this.discriminator.isStarted()) {
-      this.addError("Discriminator has not started successfully. Aborting");
-      ++errors;
-    }
-
-    if (this.appenderNamePattern == null) {
-      this.addError("Missing name pattern. Aborting");
-      ++errors;
-    }
-
-    if (errors == 0) {
-      super.start();
-    }
-  }
-}
diff --git a/common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/logback/EventTypeDiscriminator.java b/common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/logback/EventTypeDiscriminator.java
deleted file mode 100644 (file)
index 107f672..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.core.logging.logback;
-
-import ch.qos.logback.classic.Level;
-import ch.qos.logback.classic.spi.ILoggingEvent;
-import ch.qos.logback.core.sift.AbstractDiscriminator;
-import org.openecomp.core.logging.Markers;
-import org.slf4j.Marker;
-
-/**
- * Can be used with {@link ch.qos.logback.classic.sift.SiftingAppender} to route events of different
- * types to separate log files. For example,
- * <pre>
- *     &lt;configuration&gt;
- *         &lt;appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender"&gt;
- *             &lt;discriminator class="EventTypeDiscriminator"/&gt;
- *             &lt;sift&gt;
- *                  &lt;appender name="{EventType}"
- *                  class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
- *                      &lt;file&gt;${logDirectory}/${eventType}.log&lt;/file&gt;
- *                      &lt;rollingPolicy class="ch.
- *                      qos.logback.core.rolling.FixedWindowRollingPolicy"&gt;
- *                          &lt;fileNamePattern&gt;
- *                          ${logDirectory}/${eventType}.
- *                          %i.log.zip&lt;/fileNamePattern&gt;
- *                          &lt;minIndex&gt;1&lt;/minIndex&gt;
- *                          &lt;maxIndex&gt;9&lt;/maxIndex&gt;
- *                      &lt;/rollingPolicy&gt;
- *                      &lt;triggeringPolicy
- *                      class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"&gt;
- *                          &lt;maxFileSize&gt;5MB&lt;/maxFileSize&gt;
- *                      &lt;/triggeringPolicy&gt;
- *                      &lt;encoder&gt;
- *                          &lt;pattern&gt;${defaultPattern}&lt;/pattern&gt;
- *                      &lt;/encoder&gt;
- *                  &lt;/appender&gt;
- *             &lt;/sift&gt;
- *         &lt;/appender&gt;
- *         &lt;root level="INFO"&gt;
- *             &lt;appender-ref ref="SIFT" /&gt;
- *         &lt;/root&gt;
- *     &lt;/configuration&gt;
- * </pre>
- */
-public class EventTypeDiscriminator extends AbstractDiscriminator<ILoggingEvent> {
-
-  private static final String KEY = "eventType";
-
-  private static final String AUDIT = "Audit";
-  private static final String METRICS = "Metrics";
-  private static final String ERROR = "Error";
-  private static final String DEBUG = "Debug";
-  private static final String DEFAULT = DEBUG;
-
-  private static final int MIN_ERROR_LEVEL = Level.WARN_INT;
-  private static final int MAX_ERROR_LEVEL = Level.ERROR_INT;
-  private static final int DEFAULT_LEVEL = Level.DEBUG_INT;
-
-  @Override
-  public String getDiscriminatingValue(ILoggingEvent event) {
-
-    Level level = event.getLevel();
-    final int levelInt = level == null ? DEFAULT_LEVEL : level.toInt();
-    if ((levelInt > MIN_ERROR_LEVEL - 1) && (levelInt < MAX_ERROR_LEVEL + 1)) {
-      return ERROR;
-    }
-
-    if (levelInt == Level.DEBUG_INT) {
-      return DEBUG;
-    }
-
-    /*
-    * After DEBUG, ERROR, and WARNING have been filtered out,
-    * only TRACE and INFO are left. TRACE is less than DEBUG
-    * and therefore cannot be used. So, INFO should be used for
-    * custom routing like AUDIT and METRICS
-    */
-    if (levelInt == Level.INFO_INT) {
-
-      final Marker marker = event.getMarker();
-      if (marker != null) {
-
-        if (marker.contains(Markers.AUDIT)) {
-          return AUDIT;
-        }
-
-        if (marker.contains(Markers.METRICS)) {
-          return METRICS;
-        }
-      }
-
-      return ERROR;
-    }
-
-    return DEFAULT;
-  }
-
-  @Override
-  public String getKey() {
-    return KEY;
-  }
-}
diff --git a/common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/servlet/LoggingFilter.java b/common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/servlet/LoggingFilter.java
deleted file mode 100644 (file)
index 53923d7..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.core.logging.servlet;
-
-import org.slf4j.MDC;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.UUID;
-import java.util.concurrent.atomic.AtomicLong;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-
-/**
- * <p>Pushes information required by EELF onto MDC (Mapped Diagnostic Context).</p> <p>This is
- * servlet filter that should be configured in <i>web.xml</i> to be used. Example:</p>
- * <pre>
- *  &lt;filter&gt;
- *      &lt;filter-name&gt;LoggingServletFilter&lt;/filter-name&gt;
- *      &lt;filter-class&gt;LoggingFilter&lt;/filter-class&gt;
- *  &lt;/filter&gt;
- *  &lt;filter-mapping&gt;
- *      &lt;filter-name&gt;LoggingServletFilter&lt;/filter-name&gt;
- *      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
- *  &lt;/filter-mapping&gt;
- * </pre>
- */
-public class LoggingFilter implements Filter {
-
-  // should be cashed to avoid low-level call, but with a timeout to account for IP or FQDN changes
-  private static final HostAddressCache HOST_ADDRESS = new HostAddressCache();
-  private static final String UNKNOWN = "UNKNOWN";
-
-  public void destroy() {
-  }
-
-  /**
-   * Do Filter.
-   *
-   * @param request the request
-   */
-  public void doFilter(ServletRequest request, ServletResponse response,
-                       FilterChain chain) throws IOException, ServletException {
-
-    try {
-
-      MDC.clear();
-
-      MDC.put("RequestId", UUID.randomUUID().toString());
-      MDC.put("ServiceInstanceId", "N/A"); // not applicable
-      MDC.put("ServiceName", "SDC");
-      MDC.put("InstanceUUID", "N/A");
-
-      // For some reason chooses IPv4 or IPv6 in a random way
-      MDC.put("RemoteHost", request.getRemoteHost());
-
-      InetAddress host = HOST_ADDRESS.get();
-
-      String ipAddress;
-      String hostName;
-      if (host == null) {
-        ipAddress = UNKNOWN;
-        hostName = UNKNOWN;
-      } else {
-        ipAddress = host.getHostAddress();
-        hostName = host.getHostName();
-      }
-
-      MDC.put("ServerIPAddress", ipAddress);
-      MDC.put("ServerFQDN", hostName);
-
-      // TODO: Clarify what these stand for
-      //        MDC.put("AlertSeverity", );
-      //        MDC.put("Timer", );
-
-      chain.doFilter(request, response);
-
-    } finally {
-      MDC.clear();
-    }
-  }
-
-  public void init(FilterConfig config) throws ServletException {
-  }
-
-  private static class HostAddressCache {
-
-    private static final long REFRESH_TIME = 1000L;
-
-    private AtomicLong lastUpdated = new AtomicLong(0L);
-    private InetAddress hostAddress;
-
-    public InetAddress get() {
-
-      long current = System.currentTimeMillis();
-      if (current - lastUpdated.get() > REFRESH_TIME) {
-
-        synchronized (this) {
-
-          try {
-            lastUpdated.set(current); // set now to register the attempt even if failed
-            hostAddress = InetAddress.getLocalHost();
-          } catch (UnknownHostException unknownHostException) {
-            hostAddress = null;
-          }
-        }
-      }
-
-      return hostAddress;
-    }
-  }
-}
diff --git a/common/openecomp-logging-lib/openecomp-logging-core/src/main/resources/META-INF/services/org.openecomp.core.logging.api.LoggerCreationService b/common/openecomp-logging-lib/openecomp-logging-core/src/main/resources/META-INF/services/org.openecomp.core.logging.api.LoggerCreationService
deleted file mode 100644 (file)
index ecbf5e8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-org.openecomp.core.logging.Slf4JLoggerCreationService
\ No newline at end of file
diff --git a/common/openecomp-logging-lib/openecomp-logging-core/src/main/resources/META-INF/services/org.openecomp.core.logging.api.context.ContextPropagationService b/common/openecomp-logging-lib/openecomp-logging-core/src/main/resources/META-INF/services/org.openecomp.core.logging.api.context.ContextPropagationService
deleted file mode 100644 (file)
index 9129768..0000000
+++ /dev/null
@@ -1 +0,0 @@
-org.openecomp.core.logging.context.MdcPropagationService
\ No newline at end of file
diff --git a/common/openecomp-logging-lib/pom.xml b/common/openecomp-logging-lib/pom.xml
deleted file mode 100644 (file)
index 94a06fe..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <groupId>org.openecomp.sdc.common</groupId>
-    <artifactId>openecomp-logging-lib</artifactId>
-    <packaging>pom</packaging>
-
-    <parent>
-        <artifactId>openecomp-common-lib</artifactId>
-        <groupId>org.openecomp.sdc.common</groupId>
-        <version>1.2.0-SNAPSHOT</version>
-        <relativePath>..</relativePath>
-    </parent>
-
-    <modules>
-        <module>openecomp-logging-api</module>
-        <module>openecomp-logging-core</module>
-    </modules>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>javax.servlet</groupId>
-            <artifactId>servlet-api</artifactId>
-        </dependency>
-    </dependencies>
-
-</project>
index 72c2089..22a518a 100644 (file)
@@ -3,7 +3,6 @@
     <modelVersion>4.0.0</modelVersion>
 
     <name>openecomp-sdc-artifact-generator-api</name>
-    <groupId>org.openecomp.sdc.common</groupId>
     <artifactId>openecomp-sdc-artifact-generator-api</artifactId>
 
     <parent>
     </parent>
 
     <dependencies>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-logging-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-logging-core</artifactId>
+            <version>${project.version}</version>
+            <scope>runtime</scope>
+        </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
             <artifactId>reflections</artifactId>
             <version>${org.reflections.version}</version>
         </dependency>
-        <dependency>
-            <groupId>org.openecomp.sdc.common</groupId>
-            <artifactId>openecomp-logging-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.openecomp.sdc.common</groupId>
-            <artifactId>openecomp-logging-core</artifactId>
-            <version>${project.version}</version>
-        </dependency>
         <dependency>
             <groupId>org.testng</groupId>
             <artifactId>testng</artifactId>
@@ -79,6 +79,7 @@
             <scope>test</scope>
             <version>${junit.version}</version>
         </dependency>
+
     </dependencies>
     <build>
         <plugins>
index c94a851..2ac2527 100644 (file)
@@ -28,8 +28,8 @@ import static org.openecomp.sdc.generator.data.GeneratorConstants.GENERATOR_ERRO
 import static org.openecomp.sdc.generator.data.GeneratorConstants.GENERATOR_PARTNER_NAME;
 import static org.openecomp.sdc.generator.data.GeneratorConstants.PARTNER_NAME;
 
-import org.openecomp.core.logging.api.Logger;
-import org.openecomp.core.logging.api.LoggerFactory;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.generator.data.Artifact;
 import org.openecomp.sdc.generator.data.GenerationData;
 import org.openecomp.sdc.generator.logging.CategoryLogLevel;
@@ -37,7 +37,6 @@ import org.slf4j.MDC;
 
 import java.io.PrintWriter;
 import java.io.StringWriter;
-import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 
index 624df5d..43fb6f1 100644 (file)
@@ -3,7 +3,6 @@
     <modelVersion>4.0.0</modelVersion>
 
     <name>openecomp-sdc-artifact-generator-core</name>
-    <groupId>org.openecomp.sdc.common</groupId>
     <artifactId>openecomp-sdc-artifact-generator-core</artifactId>
 
     <parent>
     </parent>
 
     <dependencies>
+        <dependency>
+            <groupId>org.aspectj</groupId>
+            <artifactId>aspectjrt</artifactId>
+            <version>${aspectj.version}</version>
+        </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
-            <version>1.7.10</version>
+            <version>${slf4j.version}</version>
         </dependency>
         <dependency>
             <groupId>ch.qos.logback</groupId>
             <version>${commons.codec.version}</version>
         </dependency>
         <dependency>
-            <groupId>org.openecomp.sdc.common</groupId>
-            <artifactId>openecomp-logging-api</artifactId>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-logging-api</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
-            <groupId>org.openecomp.sdc.common</groupId>
-            <artifactId>openecomp-logging-core</artifactId>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-logging-core</artifactId>
             <version>${project.version}</version>
+            <scope>runtime</scope>
         </dependency>
         <dependency>
             <groupId>org.openecomp.sdc.common</groupId>
@@ -65,7 +70,7 @@
             <groupId>org.testng</groupId>
             <artifactId>testng</artifactId>
             <scope>test</scope>
-            <version>6.8.5</version>
+            <version>${testng.version}</version>
         </dependency>
         <dependency>
             <groupId>commons-io</groupId>
index 2d50826..90c1c33 100644 (file)
@@ -24,8 +24,8 @@ import static org.openecomp.sdc.generator.data.GeneratorConstants.GENERATOR_ERRO
 import static org.openecomp.sdc.generator.util.ArtifactGeneratorUtil.logError;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
-import org.openecomp.core.logging.api.Logger;
-import org.openecomp.core.logging.api.LoggerFactory;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.generator.data.ArtifactType;
 import org.openecomp.sdc.generator.data.GeneratorConfiguration;
 import org.openecomp.sdc.generator.intf.ArtifactGenerator;
index beb8f2d..661aec4 100644 (file)
@@ -20,8 +20,8 @@
 
 package org.openecomp.sdc.generator;
 
-import org.openecomp.core.logging.api.Logger;
-import org.openecomp.core.logging.api.LoggerFactory;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.generator.data.Artifact;
 import org.openecomp.sdc.generator.data.GenerationData;
 import org.openecomp.sdc.generator.intf.ArtifactGenerator;
index f4dd4d4..26b884e 100644 (file)
@@ -28,8 +28,8 @@ import static org.openecomp.sdc.generator.data.GeneratorConstants.GENERATOR_AAI_
 import static org.openecomp.sdc.generator.data.GeneratorConstants.ID_LENGTH;
 import static org.openecomp.sdc.generator.util.ArtifactGeneratorUtil.logError;
 
-import org.openecomp.core.logging.api.Logger;
-import org.openecomp.core.logging.api.LoggerFactory;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.generator.aai.model.AllotedResource;
 import org.openecomp.sdc.generator.aai.model.ProvidingService;
 import org.openecomp.sdc.generator.aai.model.L3NetworkWidget;
index ddddfed..7f4471c 100644 (file)
@@ -20,8 +20,8 @@
 
 package org.openecomp.sdc.generator.aai;
 
-import org.openecomp.core.logging.api.Logger;
-import org.openecomp.core.logging.api.LoggerFactory;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.generator.aai.model.Resource;
 import org.openecomp.sdc.generator.aai.model.Service;
 import org.openecomp.sdc.generator.aai.model.Widget;
index 19166df..170a9c2 100644 (file)
@@ -44,8 +44,8 @@ import static org.openecomp.sdc.generator.util.ArtifactGeneratorUtil.resetLoggin
 import org.aspectj.lang.ProceedingJoinPoint;
 import org.aspectj.lang.annotation.Around;
 import org.aspectj.lang.annotation.Aspect;
-import org.openecomp.core.logging.api.Logger;
-import org.openecomp.core.logging.api.LoggerFactory;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.generator.data.GenerationData;
 import org.openecomp.sdc.generator.logging.CategoryLogLevel;
 import org.openecomp.sdc.generator.logging.StatusCode;
index d226b00..d8c2251 100644 (file)
@@ -46,8 +46,8 @@ import static org.openecomp.sdc.generator.util.ArtifactGeneratorUtil.resetLoggin
 import org.aspectj.lang.ProceedingJoinPoint;
 import org.aspectj.lang.annotation.Around;
 import org.aspectj.lang.annotation.Aspect;
-import org.openecomp.core.logging.api.Logger;
-import org.openecomp.core.logging.api.LoggerFactory;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.generator.data.GenerationData;
 import org.openecomp.sdc.generator.logging.CategoryLogLevel;
 import org.openecomp.sdc.generator.logging.StatusCode;
index 38e1b4c..3f6148f 100644 (file)
@@ -24,8 +24,8 @@ import static org.openecomp.sdc.generator.data.GeneratorConstants.GENERATOR_ERRO
 import static org.openecomp.sdc.generator.data.GeneratorConstants.GENERATOR_INVOCATION_ERROR_CODE;
 import static org.openecomp.sdc.generator.util.ArtifactGeneratorUtil.logError;
 
-import org.openecomp.core.logging.api.Logger;
-import org.openecomp.core.logging.api.LoggerFactory;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.generator.GeneratorManager;
 import org.openecomp.sdc.generator.GeneratorTask;
 import org.openecomp.sdc.generator.data.Artifact;
index 94c332d..aa3ce46 100644 (file)
@@ -78,8 +78,8 @@ import static org.openecomp.sdc.generator.logging.ArtifactGeneratorLogResponseCo
 import static org.openecomp.sdc.generator.logging.ArtifactGeneratorLogResponseCode.SERVICE_TOSCA_MISSING;
 import static org.openecomp.sdc.generator.logging.ArtifactGeneratorLogResponseCode.UNABLE_TO_GENERATE_ARTIFACT;
 
-import org.openecomp.core.logging.api.Logger;
-import org.openecomp.core.logging.api.LoggerFactory;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.generator.data.Artifact;
 import org.openecomp.sdc.generator.logging.ArtifactGeneratorLogResponseCode;
 import org.openecomp.sdc.generator.logging.CategoryLogLevel;
index d926eb2..046cada 100644 (file)
@@ -20,7 +20,6 @@
     </properties>
 
     <modules>
-        <module>openecomp-logging-lib</module>
         <module>openecomp-sdc-artifact-generator-lib</module>
         <module>openecomp-common-configuration-management</module>
         <module>openecomp-tosca-datatype</module>
index dbe8e42..7f2a34d 100644 (file)
@@ -14,17 +14,17 @@ In 1707, Artifact Generator will generate artifacts only for A&AI.
 ###Common can be compiled easily with a `mvn clean install` at the following locations :
 
 #### common\openecomp-sdc-artifact-generator-lib
-#### common\openecomp-logging-lib
+#### common\openecomp-sdc-logging-lib
 
 ### For artifact generator, the resultant jar files are located at :
 
 #### common\openecomp-sdc-artifact-generator-lib\openecomp-sdc-artifact-generator-api\target
 #### common\openecomp-sdc-artifact-generator-lib\openecomp-sdc-artifact-generator-core\target
 
-### For openecomp-logging, the resultant jar files are located at :
+### For openecomp-sdc-logging, the resultant jar files are located at :
 
-#### common\openecomp-logging-lib\openecomp-logging-api\target
-#### common\openecomp-logging-lib\openecomp-logging-core\target
+#### common\openecomp-sdc-logging-lib\openecomp-sdc-logging-api\target
+#### common\openecomp-sdc-logging-lib\openecomp-sdc-logging-core\target
 
 ### For configuration-management, the resultant jar files are located at :
 
@@ -61,16 +61,16 @@ In 1707, Artifact Generator will generate artifacts only for A&AI.
 #### api :
 
  <dependency>
-    <groupId>org.openecomp.sdc.common</groupId>
-    <artifactId>openecomp-logging-api</artifactId>
+    <groupId>org.openecomp.sdc</groupId>
+    <artifactId>openecomp-sdc-logging-api</artifactId>
     <version>?</version>
  </dependency>
 
 #### core :
 
  <dependency>
-    <groupId>org.openecomp.sdc.common</groupId>
-    <artifactId>openecomp-logging-core</artifactId>
+    <groupId>org.openecomp.sdc</groupId>
+    <artifactId>openecomp-sdc-logging-core</artifactId>
     <version>?</version>
  </dependency>
 
index 126f781..8f4a2db 100644 (file)
@@ -35,7 +35,6 @@
     <bean id="applicationConfigManager" class="org.openecomp.sdc.applicationconfig.impl.ApplicationConfigManagerImpl"/>
 
     <!-- aspect beans -->
-    <bean id = "debugAspect" class="org.openecomp.sdc.logging.aspects.DebugAspect"/>
     <bean id = "healthCheck" class="org.openecomp.sdcrests.health.rest.services.HealthCheckImpl"/>
     <!--aop:config>
         < aspect pointcuts>
index 5766fdf..4472cfe 100644 (file)
@@ -3,7 +3,6 @@
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
-    <groupId>org.openecomp.sdc</groupId>
     <artifactId>openecomp-sdc-healing-core</artifactId>
 
     <parent>
             <artifactId>openecomp-sdc-validation-api</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <dependency>
-            <groupId>org.openecomp.sdc</groupId>
-            <artifactId>openecomp-sdc-vendor-software-product-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
     </dependencies>
 
 </project>
index d5e3e9e..c54f724 100644 (file)
             <artifactId>openecomp-sdc-healing-api</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>${junit.version}</version>
+            <scope>test</scope>
+        </dependency>
         <dependency>
             <groupId>org.openecomp.sdc</groupId>
             <artifactId>openecomp-sdc-vendor-software-product-api</artifactId>
             <artifactId>openecomp-sdc-vendor-license-api</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>${junit.version}</version>
-            <scope>test</scope>
-        </dependency>
 
     </dependencies>
 
index 20ba5eb..da44ec4 100644 (file)
@@ -1,5 +1,6 @@
 package org.openecomp.sdc.healing.healers.util;
 
+import org.junit.Assert;
 import org.openecomp.core.utilities.json.JsonUtil;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
@@ -7,7 +8,6 @@ import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
 import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
 import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil;
 import org.openecomp.sdc.tosca.services.ToscaUtil;
-import org.springframework.util.Assert;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -98,8 +98,7 @@ public class TestUtil {
       ServiceTemplate actualServiceTemplate =
           actualServiceTemplates.get(serviceTemplateName);
 
-      Assert.notNull(actualServiceTemplate,
-          "Missing service template in service model : " + serviceTemplateName);
+      Assert.assertNotNull("Missing service template in service model : " + serviceTemplateName, actualServiceTemplate);
       org.junit.Assert.assertEquals("Difference in file " + serviceTemplateName,
           JsonUtil.object2Json(expectedServiceTemplateEntry.getValue()),
           JsonUtil.object2Json(actualServiceTemplate));
diff --git a/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/pom.xml b/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/pom.xml
deleted file mode 100644 (file)
index 8623552..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>openecomp-sdc-logging-api</artifactId>
-    <name>openecomp-sdc-logging-api</name>
-
-    <parent>
-        <groupId>org.openecomp.sdc</groupId>
-        <artifactId>openecomp-logging-lib</artifactId>
-        <version>1.2.0-SNAPSHOT</version>
-    </parent>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.aspectj</groupId>
-            <artifactId>aspectjrt</artifactId>
-            <version>${aspectj.version}</version>
-        </dependency>
-    </dependencies>
-
-    <!--dependencies>
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-core</artifactId>
-            <version>${spring.framework.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-context</artifactId>
-            <version>${spring.framework.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-beans</artifactId>
-            <version>${spring.framework.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-beans</artifactId>
-            <version>${spring.framework.version}</version>
-        </dependency>
-    </dependencies-->
-
-    
-</project>
diff --git a/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/annotations/Debug.java b/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/annotations/Debug.java
deleted file mode 100644 (file)
index 0494811..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.logging.api.annotations;
-
-/**
- * Created by TALIO on 12/26/2016.
- */
-
-public @interface Debug {
-
-}
diff --git a/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/resources/logback.xml b/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/resources/logback.xml
deleted file mode 100644 (file)
index 8eb22bd..0000000
+++ /dev/null
@@ -1,284 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration scan="true" scanPeriod="5 seconds">
-
-    <property scope="system" name="OPENECOMP-component-name" value="ASDC" />
-    <property scope="system" name="OPENECOMP-subcomponent-name" value="ASDC-BE" />
-    <property file="${config.home}/catalog-be/configuration.yaml" />
-    <property scope="context" name="enable-all-log" value="false" />
-
-    <!--statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" />
-    <include resource="asdc_debug_logback.xml"/-->
-
-    <!-- value used by pattern field list (| - is inter-field separator, || - unavailable or not applicable field value) (m - mandatory, o- optional)-->
-    <!--timestamp(m)| requestID(m)| serviceInstanceID(o)| threadID(m)| physicalServerName(o)| serviceName(m)| userID(m)| logLevel(m)| severity(o)| serverIpAddress(m)| serverName(m)| clientIpAddress(o)| className(m)| timer(o)| detailedMessage(o)-->
-    <property name="default-log-pattern"
-              value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%X{uuid}|%X{serviceInstanceID}|%thread||${OPENECOMP-subcomponent-name}|%X{userId}|%level|%X{alarmSeverity}|%X{localAddr}|${beFqdn}|%X{remoteAddr}|%logger{35}|%X{timer}|ActivityType=&lt;%M&gt;, Desc=&lt;%msg&gt;%n" />
-
-    <property name="asdc-debug-log-pattern" value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%X{RequestId}|%msg %n"/>
-
-    <!-- All log -->
-    <if condition='property("enable-all-log").equalsIgnoreCase("true")'>
-        <then>
-            <appender name="ALL_ROLLING"
-                      class="ch.qos.logback.core.rolling.RollingFileAppender">
-                <file>${log.home}/${OPENECOMP-component-name}/${OPENECOMP-subcomponent-name}/all.log
-                </file>
-
-                <rollingPolicy
-                        class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
-                    <fileNamePattern>${log.home}/${OPENECOMP-component-name}/${OPENECOMP-subcomponent-name}/all.log.%i
-                    </fileNamePattern>
-                    <minIndex>1</minIndex>
-                    <maxIndex>10</maxIndex>
-                </rollingPolicy>
-
-                <triggeringPolicy
-                        class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
-                    <maxFileSize>20MB</maxFileSize>
-                </triggeringPolicy>
-                <encoder>
-                    <pattern>${default-log-pattern}</pattern>
-                </encoder>
-            </appender>
-
-            <appender name="ASYNC_ALL" class="ch.qos.logback.classic.AsyncAppender">
-                <appender-ref ref="ALL_ROLLING" />
-            </appender>
-        </then>
-    </if>
-
-    <!-- Error log -->
-    <appender name="ERROR_ROLLING"
-              class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <file>${log.home}/${OPENECOMP-component-name}/${OPENECOMP-subcomponent-name}/Error.log
-        </file>
-
-        <!-- Audit messages filter - deny audit messages -->
-        <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
-            <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator">
-                <marker>AUDIT_MARKER</marker>
-            </evaluator>
-            <onMismatch>NEUTRAL</onMismatch>
-            <onMatch>DENY</onMatch>
-        </filter>
-
-        <!-- Transaction messages filter - deny Transaction messages -->
-        <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
-            <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator">
-                <marker>TRANSACTION_MARKER</marker>
-            </evaluator>
-            <onMismatch>NEUTRAL</onMismatch>
-            <onMatch>DENY</onMatch>
-        </filter>
-
-        <!-- deny all events with a level below INFO, that is TRACE and DEBUG -->
-        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
-            <level>INFO</level>
-        </filter>
-
-        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
-            <fileNamePattern>${log.home}/${OPENECOMP-component-name}/${OPENECOMP-subcomponent-name}/Error.log.%i
-            </fileNamePattern>
-            <minIndex>1</minIndex>
-            <maxIndex>10</maxIndex>
-        </rollingPolicy>
-
-        <triggeringPolicy
-                class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
-            <maxFileSize>20MB</maxFileSize>
-        </triggeringPolicy>
-        <encoder>
-            <pattern>${default-log-pattern}</pattern>
-        </encoder>
-    </appender>
-
-    <!-- Debug log -->
-    <appender name="DEBUG_ROLLING"
-              class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <file>${log.home}/${OPENECOMP-component-name}/${OPENECOMP-subcomponent-name}/debug.log
-        </file>
-
-        <!-- No need to deny audit messages - they are INFO only, will be denied
-            anyway -->
-        <!-- Transaction messages filter - deny Transaction messages, there are
-            some DEBUG level messages among them -->
-        <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
-            <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator">
-                <marker>TRANSACTION_MARKER</marker>
-            </evaluator>
-            <onMismatch>NEUTRAL</onMismatch>
-            <onMatch>DENY</onMatch>
-        </filter>
-
-        <!-- accept DEBUG and TRACE level -->
-        <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
-            <evaluator class="ch.qos.logback.classic.boolex.GEventEvaluator">
-                <expression>
-                    e.level.toInt() &lt;= DEBUG.toInt()
-                </expression>
-            </evaluator>
-            <OnMismatch>DENY</OnMismatch>
-            <OnMatch>NEUTRAL</OnMatch>
-        </filter>
-
-        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
-            <fileNamePattern>${log.home}/${OPENECOMP-component-name}/${OPENECOMP-subcomponent-name}/debug.log.%i
-            </fileNamePattern>
-            <minIndex>1</minIndex>
-            <maxIndex>10</maxIndex>
-        </rollingPolicy>
-
-        <triggeringPolicy
-                class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
-            <maxFileSize>20MB</maxFileSize>
-        </triggeringPolicy>
-        <encoder>
-            <pattern>${default-log-pattern}</pattern>
-        </encoder>
-    </appender>
-
-    <!-- Debug log -->
-    <appender name="PACKAGE_DEBUG_ROLLING"
-              class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <file>${log.home}/${OPENECOMP-component-name}/${OPENECOMP-subcomponent-name}/debug_by_package.log
-        </file>
-
-        <!-- No need to deny audit messages - they are INFO only, will be denied
-            anyway -->
-        <!-- Transaction messages filter - deny Transaction messages, there are
-            some DEBUG level messages among them -->
-        <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
-            <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator">
-                <marker>TRANSACTION_MARKER</marker>
-            </evaluator>
-            <onMismatch>NEUTRAL</onMismatch>
-            <onMatch>DENY</onMatch>
-        </filter>
-
-        <!-- accept DEBUG and TRACE level -->
-        <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
-            <evaluator class="ch.qos.logback.classic.boolex.GEventEvaluator">
-                <expression>
-                    e.level.toInt() &lt;= DEBUG.toInt()
-                </expression>
-            </evaluator>
-            <OnMismatch>DENY</OnMismatch>
-            <OnMatch>NEUTRAL</OnMatch>
-        </filter>
-
-        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
-            <fileNamePattern>${log.home}/${OPENECOMP-component-name}/${OPENECOMP-subcomponent-name}/debug_by_package.log.%i
-            </fileNamePattern>
-            <minIndex>1</minIndex>
-            <maxIndex>10</maxIndex>
-        </rollingPolicy>
-
-        <triggeringPolicy
-                class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
-            <maxFileSize>20MB</maxFileSize>
-        </triggeringPolicy>
-        <encoder>
-            <pattern>${asdc-debug-log-pattern}</pattern>
-        </encoder>
-    </appender>
-
-    <!-- Audit log -->
-    <appender name="AUDIT_ROLLING"
-              class="ch.qos.logback.core.rolling.RollingFileAppender">
-
-        <file>${log.home}/${OPENECOMP-component-name}/${OPENECOMP-subcomponent-name}/audit.log
-        </file>
-
-        <!-- Audit messages filter - accept audit messages -->
-        <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
-            <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator">
-                <marker>AUDIT_MARKER</marker>
-            </evaluator>
-            <onMismatch>DENY</onMismatch>
-            <onMatch>ACCEPT</onMatch>
-        </filter>
-
-        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
-            <fileNamePattern>${log.home}/${OPENECOMP-component-name}/${OPENECOMP-subcomponent-name}/audit.log.%i
-            </fileNamePattern>
-            <minIndex>1</minIndex>
-            <maxIndex>10</maxIndex>
-        </rollingPolicy>
-
-        <triggeringPolicy
-                class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
-            <maxFileSize>20MB</maxFileSize>
-        </triggeringPolicy>
-        <encoder>
-            <pattern>${default-log-pattern}</pattern>
-        </encoder>
-    </appender>
-
-    <!-- SdncTransaction log -->
-    <appender name="TRANSACTION_ROLLING"
-              class="ch.qos.logback.core.rolling.RollingFileAppender">
-
-        <file>${log.home}/${OPENECOMP-component-name}/${OPENECOMP-subcomponent-name}/transaction.log
-        </file>
-
-        <!-- Transaction messages filter - accept audit messages -->
-        <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
-            <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator">
-                <marker>TRANSACTION_MARKER</marker>
-            </evaluator>
-            <onMismatch>DENY</onMismatch>
-            <onMatch>ACCEPT</onMatch>
-        </filter>
-
-        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
-            <fileNamePattern>${log.home}/${OPENECOMP-component-name}/${OPENECOMP-subcomponent-name}/transaction.log.%i
-            </fileNamePattern>
-            <minIndex>1</minIndex>
-            <maxIndex>10</maxIndex>
-        </rollingPolicy>
-
-        <triggeringPolicy
-                class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
-            <maxFileSize>20MB</maxFileSize>
-        </triggeringPolicy>
-        <encoder>
-            <pattern>${default-log-pattern}</pattern>
-        </encoder>
-    </appender>
-
-    <!-- Asynchronicity Configurations -->
-    <appender name="ASYNC_DEBUG" class="ch.qos.logback.classic.AsyncAppender">
-        <appender-ref ref="DEBUG_ROLLING" />
-    </appender>
-
-    <appender name="ASYNC_TRANSACTION" class="ch.qos.logback.classic.AsyncAppender">
-        <appender-ref ref="TRANSACTION_ROLLING" />
-    </appender>
-
-    <appender name="ASYNC_ERROR" class="ch.qos.logback.classic.AsyncAppender">
-        <appender-ref ref="ERROR_ROLLING" />
-    </appender>
-
-
-    <root level="INFO">
-        <appender-ref ref="ASYNC_ERROR" />
-        <appender-ref ref="ASYNC_DEBUG" />
-        <appender-ref ref="AUDIT_ROLLING" />
-        <appender-ref ref="ASYNC_TRANSACTION" />
-        <if condition='property("enable-all-log").equalsIgnoreCase("true")'>
-            <then>
-                <appender-ref ref="ALL_ROLLING" />
-            </then>
-        </if>
-    </root>
-
-    <logger name="org.openecomp.sdc" level="INFO" />
-
-    <logger name="org.openecomp.sdc.vendorsoftwareproduct" level="DEBUG" additivity ="false">
-        <appender-ref ref="PACKAGE_DEBUG_ROLLING" />
-    </logger>
-
-    <logger name="org.openecomp.sdc.vendorlicense" level="DEBUG" additivity ="false">
-        <appender-ref ref="PACKAGE_DEBUG_ROLLING" />
-    </logger>
-</configuration>
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/pom.xml b/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/pom.xml
deleted file mode 100644 (file)
index be8e552..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <name>openecomp-sdc-logging-core</name>
-    <groupId>org.openecomp.sdc</groupId>
-    <artifactId>openecomp-sdc-logging-core</artifactId>
-    
-    <parent>
-        <groupId>org.openecomp.sdc</groupId>
-        <artifactId>openecomp-logging-lib</artifactId>
-        <version>1.2.0-SNAPSHOT</version>
-    </parent>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.openecomp.sdc</groupId>
-            <artifactId>openecomp-sdc-logging-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-context</artifactId>
-            <version>${spring.framework.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-webmvc</artifactId>
-            <version>${spring.framework.version}</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>ch.qos.logback</groupId>
-            <artifactId>logback-classic</artifactId>
-            <version>${logback.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>javax.servlet</groupId>
-            <artifactId>servlet-api</artifactId>
-            <version>${servlet.version}</version>
-        </dependency>
-    </dependencies>
-
-</project>
diff --git a/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/aspects/DebugAspect.java b/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/aspects/DebugAspect.java
deleted file mode 100644 (file)
index 7ac5be0..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.logging.aspects;
-
-import org.aspectj.lang.JoinPoint;
-import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
-import org.slf4j.Marker;
-import org.slf4j.MarkerFactory;
-
-import java.lang.reflect.Method;
-
-
-/**
- * Created by TALIO on 12/26/2016.
- */
-public class DebugAspect {
-
-  private static final String MESSAGE_TEMPLATE = "'{}' '{}' with '{}'";
-  private static final Marker DEBUG = MarkerFactory.getMarker("DEBUG");
-  private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
-
-//  @Autowired
-//  private ParameterNameDiscoverer parameterNameDiscoverer;
-
-  public void debugEnterMethod(final JoinPoint joinPoint){
-
-    Class type = joinPoint.getSignature().getDeclaringType();
-    Method currentMethod = null;
-    for(Method method : type.getMethods()){
-      if(method.getName().equals(joinPoint.getSignature().getName())){
-        currentMethod = method;
-        break;
-      }
-    }
-
-//    String[] parameterNames = parameterNameDiscoverer.getParameterNames(currentMethod);
-//    Object[] args = joinPoint.getArgs();
-//    Parameter[] parameters = currentMethod.getParameters();
-//    StringBuilder str = new StringBuilder(joinPoint.getSignature().getName() + " with parameters:" +
-//        " ");
-//    if(args.length == parameters.length) {
-//      for (int i = 0; i < args.length; i++) {
-//        str.append(parameters[i].getName()).append('=').append(args[i]);
-//      }
-//    }
-    mdcDataDebugMessage.debugEntryMessage(null, null);
-  }
-
-  public void debugExitMethod(final JoinPoint joinPoint){
-    mdcDataDebugMessage.debugExitMessage(null, null);
-  }
-}
diff --git a/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/method/LoggingInvocationHandler.java b/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/method/LoggingInvocationHandler.java
deleted file mode 100644 (file)
index 8718445..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.logging.method;
-
-import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-
-/**
- * Created by TALIO on 1/8/2017.
- */
-public class LoggingInvocationHandler implements InvocationHandler {
-
-  private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
-  private final Object invocImpl;
-
-  public LoggingInvocationHandler(final Object invocImpl){
-    this.invocImpl = invocImpl;
-  }
-
-  @Override
-  public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
-    mdcDataDebugMessage.debugEntryMessage(null, null);
-    return method.invoke(invocImpl, args);
-  }
-}
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/pom.xml b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/pom.xml
new file mode 100644 (file)
index 0000000..3158995
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>openecomp-sdc-logging-api</artifactId>
+    <name>openecomp-sdc-logging-api</name>
+
+    <parent>
+        <groupId>org.openecomp.sdc</groupId>
+        <artifactId>openecomp-sdc-logging-lib</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>${slf4j-api.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-simple</artifactId>
+            <version>${slf4j.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <version>${testng.version}</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+</project>
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.core.logging.api;
+package org.openecomp.sdc.logging.api;
 
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
 import java.util.ServiceLoader;
 
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.*;
 
 /**
  * @author evitaliy
@@ -44,7 +42,7 @@ public class LoggerFactoryTest {
     Field factory = LoggerFactory.class.getDeclaredField("SERVICE");
     factory.setAccessible(true);
     Object impl = factory.get(null);
-    assertEquals("org.openecomp.core.logging.api.LoggerFactory$NoOpLoggerCreationService",
+    assertEquals("org.openecomp.sdc.logging.api.LoggerFactory$NoOpLoggerCreationService",
         impl.getClass().getName());
   }
 
@@ -3,33 +3,25 @@
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
-
-    <name>openecomp-configuration-management-test</name>
-    <groupId>org.openecomp.sdc.common</groupId>
-    <artifactId>openecomp-logging-core</artifactId>
-
+    <name>openecomp-sdc-logging-core</name>
+    <artifactId>openecomp-sdc-logging-core</artifactId>
+    
     <parent>
-        <artifactId>openecomp-logging-lib</artifactId>
-        <groupId>org.openecomp.sdc.common</groupId>
+        <groupId>org.openecomp.sdc</groupId>
+        <artifactId>openecomp-sdc-logging-lib</artifactId>
         <version>1.2.0-SNAPSHOT</version>
-        <relativePath>..</relativePath>
     </parent>
 
-    <properties>
-        <logback.version>1.1.7</logback.version>
-        <powermock.version>1.6.5</powermock.version>
-        <easymock.version>3.4</easymock.version>
-    </properties>
-
     <dependencies>
         <dependency>
-            <groupId>org.aspectj</groupId>
-            <artifactId>aspectjrt</artifactId>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-logging-api</artifactId>
+            <version>${project.version}</version>
         </dependency>
         <dependency>
-            <groupId>org.openecomp.sdc.common</groupId>
-            <artifactId>openecomp-logging-api</artifactId>
-            <version>${project.version}</version>
+            <groupId>org.aspectj</groupId>
+            <artifactId>aspectjrt</artifactId>
+            <version>${aspectj.version}</version>
         </dependency>
         <dependency>
             <groupId>ch.qos.logback</groupId>
             <version>${logback.version}</version>
         </dependency>
         <dependency>
-            <groupId>ch.qos.logback</groupId>
-            <artifactId>logback-core</artifactId>
-            <version>${logback.version}</version>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>${servlet.version}</version>
+        </dependency>
+               
+               <!-- for testing -->
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <version>${testng.version}</version>
+            <scope>test</scope>
         </dependency>
-
-        <!-- for testing -->
         <dependency>
             <groupId>org.easymock</groupId>
             <artifactId>easymock</artifactId>
@@ -32,23 +32,23 @@ public class SLF4JLoggerCreationService implements LoggerCreationService {
 
     @Override
     public Logger getLogger(String className) {
-        return new SFL4JWrapper(className);
+        return new SLF4JWrapper(className);
     }
 
     @Override
     public Logger getLogger(Class<?> clazz) {
-        return new SFL4JWrapper(clazz);
+        return new SLF4JWrapper(clazz);
     }
 
-    private class SFL4JWrapper implements Logger {
+    private class SLF4JWrapper implements Logger {
 
         private final org.slf4j.Logger logger;
 
-        public SFL4JWrapper(Class<?> clazz) {
+        SLF4JWrapper(Class<?> clazz) {
             logger = LoggerFactory.getLogger(clazz);
         }
 
-        public SFL4JWrapper(String className) {
+        SLF4JWrapper(String className) {
             logger = LoggerFactory.getLogger(className);
         }
 
 
 package org.openecomp.sdc.logging.aspects;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.aspectj.lang.ProceedingJoinPoint;
 import org.aspectj.lang.annotation.Around;
 import org.aspectj.lang.annotation.Aspect;
-import org.slf4j.Marker;
-import org.slf4j.MarkerFactory;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+import org.openecomp.sdc.logging.api.annotations.Metrics;
 
 /**
  * <p>Wraps around any method annotated with {@link Metrics} to measure and log its execution time
@@ -45,14 +44,13 @@ import org.slf4j.MarkerFactory;
 public class MetricsAspect {
 
   private static final String MESSAGE_TEMPLATE = "'{}' took {} milliseconds";
-  private static final Marker METRICS = MarkerFactory.getMarker("METRICS");
 
   @Around("@annotation(org.openecomp.sdc.logging.api.annotations.Metrics)")
   public Object logExecutionTime(ProceedingJoinPoint pjp) throws Throwable {
 
     final Logger logger = LoggerFactory.getLogger(pjp.getSignature().getDeclaringTypeName());
     // measure and log only if the logger for this class is enabled
-    if (logger.isInfoEnabled()) {
+    if (logger.isMetricsEnabled()) {
 
       final String method = pjp.getSignature().getName();
       final long start = System.currentTimeMillis();
@@ -60,7 +58,7 @@ public class MetricsAspect {
       try {
         return pjp.proceed();
       } finally {
-        logger.info(METRICS, MESSAGE_TEMPLATE, method, System.currentTimeMillis() - start);
+        logger.metrics(MESSAGE_TEMPLATE, method, System.currentTimeMillis() - start);
       }
 
     } else {
@@ -70,10 +70,10 @@ public class MdcDataDebugMessage extends MdcData {
     logDebugMessage(entityParameter, DebugConstants.EXIT, ids);
   }
 
-  public void logDebugMessage(String entityParameter, String enterOrExit, String... ids) {
+  private void logDebugMessage(String entityParameter, String enterOrExit, String... ids) {
     String methodName = LoggingUtils.getCallingMethodNameForDebugging();
     String declaringClass = LoggingUtils.getDeclaringClass();
-    logger = (Logger) LoggerFactory.getLogger(declaringClass);
+    logger = LoggerFactory.getLogger(declaringClass);
     String messageToWrite;
 
     if (entityParameter == null || ids == null) {
@@ -20,7 +20,6 @@
 
 package org.openecomp.sdc.logging.servlet;
 
-import org.omg.CORBA.Request;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.slf4j.MDC;
@@ -63,7 +62,7 @@ public class LoggingFilter implements Filter {
     private static final HostAddressCache HOST_ADDRESS = new HostAddressCache();
     private static final String UNKNOWN = "UNKNOWN";
 
-    private final static Logger log = (Logger) LoggerFactory.getLogger(LoggingFilter.class.getName());
+    private final static Logger LOGGER = LoggerFactory.getLogger(LoggingFilter.class);
 
     public void destroy() {
     }
@@ -118,7 +117,7 @@ public class LoggingFilter implements Filter {
 
         private static final long REFRESH_TIME = 1000L;
 
-        private AtomicLong lastUpdated = new AtomicLong(0L);
+        private final AtomicLong lastUpdated = new AtomicLong(0L);
         private InetAddress hostAddress;
 
         public InetAddress get() {
@@ -132,7 +131,7 @@ public class LoggingFilter implements Filter {
                         lastUpdated.set(current); // set now to register the attempt even if failed
                         hostAddress = InetAddress.getLocalHost();
                     } catch (UnknownHostException e) {
-                        log.debug("",e);
+                        LOGGER.error("Failed to retrieve local hostname for logging", e);
                         hostAddress = null;
                     }
                 }
@@ -1,6 +1,6 @@
-package org.openecomp.core.logging;
+package org.openecomp.sdc.logging;
 
-import org.openecomp.core.logging.api.LoggerFactory;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
@@ -20,6 +20,6 @@ public class LoggerFactoryTest {
     Field factory = LoggerFactory.class.getDeclaredField("SERVICE");
     factory.setAccessible(true);
     Object implementation = factory.get(null);
-    assertEquals(Slf4JLoggerCreationService.class, implementation.getClass());
+    assertEquals(SLF4JLoggerCreationService.class, implementation.getClass());
   }
 }
\ No newline at end of file
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.core.logging;
+package org.openecomp.sdc.logging;
 
 import ch.qos.logback.classic.Level;
 import ch.qos.logback.classic.Logger;
 import ch.qos.logback.classic.sift.SiftingAppender;
 import ch.qos.logback.classic.spi.ILoggingEvent;
 import ch.qos.logback.core.AppenderBase;
-import org.openecomp.core.logging.logback.EventTypeDiscriminator;
+import org.openecomp.sdc.logging.logback.EventTypeDiscriminator;
 import org.slf4j.LoggerFactory;
 import org.testng.Assert;
 import org.testng.annotations.BeforeClass;
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.core.logging.aspects;
+package org.openecomp.sdc.logging.aspects;
 
-import org.openecomp.core.logging.api.Logger;
-import org.openecomp.core.logging.api.LoggerFactory;
 import org.aspectj.lang.ProceedingJoinPoint;
 import org.aspectj.lang.Signature;
 import org.aspectj.lang.reflect.SourceLocation;
 import org.aspectj.runtime.internal.AroundClosure;
 import org.easymock.EasyMock;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.powermock.api.easymock.PowerMock;
 import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.testng.PowerMockTestCase;
 import org.testng.Assert;
 import org.testng.annotations.Test;
-import sun.reflect.generics.reflectiveObjects.NotImplementedException;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -253,13 +252,13 @@ public class MetricsAspectTest extends PowerMockTestCase {
     private final boolean enabled;
     private List<Object[]> events = Collections.synchronizedList(new ArrayList<>(10));
 
-    public TestLogger(boolean enabled) {
+    TestLogger(boolean enabled) {
       this.enabled = enabled;
     }
 
     @Override
     public String getName() {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
@@ -269,12 +268,12 @@ public class MetricsAspectTest extends PowerMockTestCase {
 
     @Override
     public void metrics(String var1) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void metrics(String var1, Object var2) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
@@ -287,162 +286,162 @@ public class MetricsAspectTest extends PowerMockTestCase {
 
     @Override
     public void metrics(String var1, Object... var2) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void metrics(String var1, Throwable throwable) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public boolean isAuditEnabled() {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void audit(String var1) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void audit(String var1, Object var2) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void audit(String var1, Object var2, Object var3) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void audit(String var1, Object... var2) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void audit(String var1, Throwable throwable) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public boolean isDebugEnabled() {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void debug(String var1) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void debug(String var1, Object var2) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void debug(String var1, Object var2, Object var3) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void debug(String var1, Object... var2) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void debug(String var1, Throwable throwable) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public boolean isInfoEnabled() {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void info(String var1) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void info(String var1, Object var2) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void info(String var1, Object var2, Object var3) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void info(String var1, Object... var2) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void info(String var1, Throwable throwable) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public boolean isWarnEnabled() {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void warn(String var1) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void warn(String var1, Object var2) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void warn(String var1, Object... var2) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void warn(String var1, Object var2, Object var3) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void warn(String var1, Throwable throwable) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public boolean isErrorEnabled() {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void error(String var1) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void error(String var1, Object var2) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void error(String var1, Object var2, Object var3) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void error(String var1, Object... var2) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     @Override
     public void error(String var1, Throwable throwable) {
-      throw new NotImplementedException();
+      throw new RuntimeException("Not implemented");
     }
 
     public boolean contains(Predicate<Object[]> predicate) {
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.core.logging.context;
+package org.openecomp.sdc.logging.context;
 
 import org.slf4j.MDC;
 import org.testng.annotations.Test;
@@ -34,7 +34,12 @@ import static org.testng.Assert.*;
  */
 public class MDCPropagationFactoryTest {
 
-  @Test
+  // Disable if an old version of MDC implementation is being used.
+  // MDCPropagationFactory should be used when MDC is not propagated to child threads.
+  // See https://jira.qos.ch/browse/LOGBACK-422 and https://jira.qos.ch/browse/LOGBACK-624
+  private static final boolean ENABLED = false;
+
+  @Test(enabled = ENABLED)
   public void testNoPropagation() throws InterruptedException {
 
     String uuid = UUID.randomUUID().toString();
@@ -42,7 +47,8 @@ public class MDCPropagationFactoryTest {
     MDC.put("data", uuid);
 
     Runnable runnable = () -> {
-      assertNull(MDC.get("data"));
+      assertNull(MDC.get("data"), "Data unexpectedly copied to a child thread. " +
+              "Are you using an old version of MDC implementation (e.g. logback)?");
       complete.set(true);
     };
 
@@ -50,32 +56,33 @@ public class MDCPropagationFactoryTest {
     thread.start();
     thread.join();
 
-    assertEquals(MDC.get("data"), uuid);
-    assertTrue(complete.get());
+    assertEquals(MDC.get("data"), uuid, "Expected data to be retained in this thread");
+    assertTrue(complete.get(), "Expected the inner thread to run");
   }
 
-  @Test
+  @Test(enabled = ENABLED)
   public void testPropagation() throws InterruptedException {
 
     String uuid = UUID.randomUUID().toString();
     AtomicBoolean complete = new AtomicBoolean(false);
     MDC.put("data", uuid);
 
-    MdcPropagationService factory = new MdcPropagationService();
+    MDCPropagationService factory = new MDCPropagationService();
     Runnable runnable = factory.create(() -> {
-      assertEquals(MDC.get("data"), uuid);
+      assertEquals(MDC.get("data"), uuid, "Expected data to be propagated to the child thread's MDC");
       complete.set(true);
     });
 
     Thread thread = new Thread(runnable);
     thread.start();
+
     thread.join();
 
-    assertEquals(MDC.get("data"), uuid);
-    assertTrue(complete.get());
+    assertEquals(MDC.get("data"), uuid, "Expected data to be retained in this thread");
+    assertTrue(complete.get(), "Expected the inner thread to run");
   }
 
-  @Test
+  @Test(enabled = ENABLED)
   public void testReplacement() throws InterruptedException {
 
     String innerUuid = UUID.randomUUID().toString();
@@ -84,11 +91,11 @@ public class MDCPropagationFactoryTest {
 
     MDC.put("data", innerUuid);
 
-    MdcPropagationService factory = new MdcPropagationService();
+    MDCPropagationService factory = new MDCPropagationService();
 
     // should run with the context of main thread
     Runnable inner = factory.create(() -> {
-      assertEquals(MDC.get("data"), innerUuid);
+      assertEquals(MDC.get("data"), innerUuid, "Expected data to be propagated to the child thread's MDC");
       innerComplete.set(true);
     });
 
@@ -97,7 +104,7 @@ public class MDCPropagationFactoryTest {
       String outerUuid = UUID.randomUUID().toString();
       MDC.put("data", outerUuid);
       inner.run();
-      assertEquals(MDC.get("data"), outerUuid);
+      assertEquals(MDC.get("data"), outerUuid, "Expected MDC data to be replaced with stored data");
       outerComplete.set(true);
     };
 
@@ -106,22 +113,22 @@ public class MDCPropagationFactoryTest {
     thread.start();
     thread.join();
 
-    assertEquals(MDC.get("data"), innerUuid);
-    assertTrue(outerComplete.get());
-    assertTrue(innerComplete.get());
+    assertEquals(MDC.get("data"), innerUuid, "Expected data to be retained in this thread");
+    assertTrue(outerComplete.get(), "Expected the outer thread to run");
+    assertTrue(innerComplete.get(), "Expected the inner thread to run");
   }
 
-  @Test
+  @Test(enabled = ENABLED)
   public void testEmpty() throws InterruptedException {
 
     final AtomicBoolean complete = new AtomicBoolean(false);
 
     MDC.remove("data");
-    assertNull(MDC.get("data"));
+    assertNull(MDC.get("data"), "Expected MDC data to be empty");
 
-    MdcPropagationService factory = new MdcPropagationService();
+    MDCPropagationService factory = new MDCPropagationService();
     Runnable runnable = factory.create(() -> {
-      assertNull(MDC.get("data"));
+      assertNull(MDC.get("data"), "Expected MDC data to be empty");
       complete.set(true);
     });
 
@@ -129,11 +136,11 @@ public class MDCPropagationFactoryTest {
     thread.start();
     thread.join();
 
-    assertNull(MDC.get("data"));
-    assertTrue(complete.get());
+    assertNull(MDC.get("data"), "Expected MDC data to be empty");
+    assertTrue(complete.get(), "Expected the inner thread to run");
   }
 
-  @Test
+  @Test(enabled = ENABLED)
   public void testCleanup() throws Exception {
 
     String innerUuid = UUID.randomUUID().toString();
@@ -142,19 +149,19 @@ public class MDCPropagationFactoryTest {
 
     MDC.put("data", innerUuid);
 
-    MdcPropagationService factory = new MdcPropagationService();
+    MDCPropagationService factory = new MDCPropagationService();
 
     // should run with the context of main thread
     Runnable inner = factory.create(() -> {
-      assertEquals(MDC.get("data"), innerUuid);
+      assertEquals(MDC.get("data"), innerUuid, "Expected data to be propagated to the child thread's MDC");
       innerComplete.set(true);
     });
 
     // pushes its own context, but runs the inner runnable
     Runnable outer = () -> {
-      assertNull(MDC.get("data"));
+      assertNull(MDC.get("data"), "Expected MDC data not to be copied to this thread");
       inner.run();
-      assertNull(MDC.get("data"));
+      assertNull(MDC.get("data"), "Expected MDC data to remain empty in this thread");
       outerComplete.set(true);
     };
 
@@ -162,12 +169,12 @@ public class MDCPropagationFactoryTest {
     thread.start();
     thread.join();
 
-    assertEquals(MDC.get("data"), innerUuid);
-    assertTrue(outerComplete.get());
-    assertTrue(innerComplete.get());
+    assertEquals(MDC.get("data"), innerUuid, "Expected MDC data to be retained in parent thread");
+    assertTrue(outerComplete.get(), "Expected the outer thread to run");
+    assertTrue(innerComplete.get(), "Expected the inner thread to run");
   }
 
-  @Test
+  @Test(enabled = ENABLED)
   public void testCleanupAfterError() throws Exception {
 
     String innerUuid = UUID.randomUUID().toString();
@@ -177,11 +184,11 @@ public class MDCPropagationFactoryTest {
 
     MDC.put("data", innerUuid);
 
-    MdcPropagationService factory = new MdcPropagationService();
+    MDCPropagationService factory = new MDCPropagationService();
 
     // should run with the context of main thread
     Runnable inner = factory.create(() -> {
-      assertEquals(MDC.get("data"), innerUuid);
+      assertEquals(MDC.get("data"), innerUuid, "Expected data to be propagated to the child thread's MDC");
       innerComplete.set(true);
       throw new RuntimeException();
     });
@@ -191,14 +198,14 @@ public class MDCPropagationFactoryTest {
 
       String outerUuid = UUID.randomUUID().toString();
       MDC.put("data", outerUuid);
-      assertEquals(MDC.get("data"), outerUuid);
+      assertEquals(MDC.get("data"), outerUuid, "Expected MDC data to be populated in this thread");
 
       try {
         inner.run();
       } catch (RuntimeException e) {
         exceptionThrown.set(true);
       } finally {
-        assertEquals(MDC.get("data"), outerUuid);
+        assertEquals(MDC.get("data"), outerUuid, "Expected MDC data to be reverted even in case of exception");
         outerComplete.set(true);
       }
     };
@@ -207,10 +214,10 @@ public class MDCPropagationFactoryTest {
     thread.start();
     thread.join();
 
-    assertEquals(MDC.get("data"), innerUuid);
-    assertTrue(outerComplete.get());
-    assertTrue(innerComplete.get());
-    assertTrue(exceptionThrown.get());
+    assertEquals(MDC.get("data"), innerUuid, "Expected MDC data to be retained in parent thread");
+    assertTrue(outerComplete.get(), "Expected the outer thread to run");
+    assertTrue(innerComplete.get(), "Expected the inner thread to run");
+    assertTrue(exceptionThrown.get(), "Expected the inner class to throw exception");
   }
 
 }
@@ -1,6 +1,6 @@
-package org.openecomp.core.logging.context;
+package org.openecomp.sdc.logging.context;
 
-import org.openecomp.core.logging.api.context.TaskFactory;
+import org.openecomp.sdc.logging.api.context.TaskFactory;
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
@@ -21,6 +21,6 @@ public class TaskFactoryTest {
     Field factory = TaskFactory.class.getDeclaredField("SERVICE");
     factory.setAccessible(true);
     Object implementation = factory.get(null);
-    assertEquals(MdcPropagationService.class, implementation.getClass());
+    assertEquals(MDCPropagationService.class, implementation.getClass());
   }
 }
\ No newline at end of file
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.core.logging.servlet;
+package org.openecomp.sdc.logging.servlet;
 
 import org.slf4j.MDC;
 import org.testng.Assert;
@@ -218,7 +218,7 @@ public class LoggingFilterTest {
 
       Assert.assertNotNull(MDC.get("RequestId"));
       Assert.assertEquals(MDC.get("ServiceInstanceId"), "N/A");
-      Assert.assertEquals(MDC.get("ServiceName"), "SDC");
+      Assert.assertEquals(MDC.get("ServiceName"), "ASDC");
       Assert.assertEquals(MDC.get("InstanceUUID"), "N/A");
       Assert.assertEquals(MDC.get("RemoteHost"), REMOTE_HOST);
 
         <appender-ref ref="asyncEELFDebug" />
   </logger>
 
-  <appender name="DISPATCHER" class="org.openecomp.core.logging.logback.DispatchingAppender">
-    <discriminator class="org.openecomp.core.logging.logback.EventTypeDiscriminator"/>
+  <appender name="DISPATCHER" class="org.openecomp.sdc.logging.logback.DispatchingAppender">
+    <discriminator class="org.openecomp.sdc.logging.logback.EventTypeDiscriminator"/>
     <appenderNamePattern>asyncEELF%s</appenderNamePattern>
   </appender>
   
@@ -15,7 +15,7 @@
     </appender>
 
     <appender name="DISPATCHER" class="ch.qos.logback.classic.sift.SiftingAppender">
-        <discriminator class="org.openecomp.core.logging.logback.EventTypeDiscriminator"/>
+        <discriminator class="org.openecomp.sdc.logging.logback.EventTypeDiscriminator"/>
         <sift>
             <appender name="${eventType}" class="ch.qos.logback.core.rolling.RollingFileAppender">
                 <file>${logDirectory}/${eventType}.log</file>
@@ -16,7 +16,7 @@
     </appender>
 
     <appender name="DISPATCHER" class="ch.qos.logback.classic.sift.SiftingAppender">
-        <discriminator class="org.openecomp.core.logging.logback.EventTypeDiscriminator"/>
+        <discriminator class="org.openecomp.sdc.logging.logback.EventTypeDiscriminator"/>
         <sift>
             <appender name="${eventType}" class="ch.qos.logback.core.rolling.RollingFileAppender">
                 <file>${logDirectory}/${eventType}.log</file>
@@ -4,22 +4,19 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
-    <groupId>org.openecomp.sdc</groupId>
-    <name>openecomp-logging-lib</name>
-    <artifactId>openecomp-logging-lib</artifactId>
+    <name>openecomp-sdc-logging-lib</name>
+    <artifactId>openecomp-sdc-logging-lib</artifactId>
     <packaging>pom</packaging>
 
     <parent>
         <groupId>org.openecomp.sdc</groupId>
         <artifactId>openecomp-sdc-lib</artifactId>
         <version>1.2.0-SNAPSHOT</version>
-        <relativePath>..</relativePath>
     </parent>
 
     <modules>
-        <module>/openecomp-sdc-logging-api</module>
-        <module>/openecomp-sdc-logging-core</module>
+        <module>openecomp-sdc-logging-api</module>
+        <module>openecomp-sdc-logging-core</module>
     </modules>
 
-    
 </project>
index 868d0c6..ea1faae 100644 (file)
@@ -28,7 +28,7 @@
         <module>openecomp-tosca-lib</module>
         <module>openecomp-sdc-action-lib</module>
         <module>openecomp-sdc-enrichment-lib</module>
-        <module>openecomp-logging-lib</module>
+        <module>openecomp-sdc-logging-lib</module>
         <module>openecomp-healing-lib</module>
         <module>openecomp-sdc-activity-log-lib</module>
         <module>openecomp-tosca-converter-lib</module>