Upgrade log4j to 2.13.1 and add log4j api 2.13.1. 09/110309/5
authorMaciej Malewski <maciej.malewski@nokia.com>
Fri, 17 Jul 2020 06:31:51 +0000 (08:31 +0200)
committerMaciej Malewski <maciej.malewski@nokia.com>
Tue, 21 Jul 2020 06:35:51 +0000 (08:35 +0200)
Issue-ID: OPTFRA-752
Signed-off-by: Maciej Malewski <maciej.malewski@nokia.com>
Change-Id: Ib39de5e892f00c07c812a8dc8d3ac7d1fca009cf

38 files changed:
cmso-database/src/main/java/org/onap/optf/cmso/liquibase/LiquibaseApplication.java
cmso-database/src/test/java/org/onap/optf/cmso/liquibase/LiquibaseApplicationTests.java
cmso-logger/pom.xml [new file with mode: 0644]
cmso-logger/src/main/java/org/onap/logger/Logger.java [new file with mode: 0644]
cmso-logger/src/main/java/org/onap/observations/ObservationInterface.java [moved from cmso-service/src/main/java/org/onap/observations/ObservationInterface.java with 81% similarity]
cmso-optimizer/pom.xml
cmso-optimizer/src/main/java/org/onap/optf/cmso/optimizer/common/LogMessages.java
cmso-optimizer/src/main/java/org/onap/optf/cmso/optimizer/exceptions/CmsoException.java
cmso-optimizer/src/main/java/org/onap/optf/cmso/optimizer/observations/Mdc.java
cmso-optimizer/src/main/java/org/onap/optf/cmso/optimizer/observations/Observation.java
cmso-optimizer/src/main/java/org/onap/optf/cmso/optimizer/observations/ObservationInterface.java [deleted file]
cmso-optimizer/src/main/java/org/onap/optf/cmso/optimizer/observations/ObservationObject.java
cmso-service/pom.xml
cmso-service/src/main/java/org/onap/observations/Observation.java
cmso-service/src/main/java/org/onap/observations/ObservationObject.java
cmso-service/src/main/java/org/onap/optf/cmso/common/DomainsEnum.java
cmso-service/src/main/java/org/onap/optf/cmso/common/LogMessages.java
cmso-service/src/main/java/org/onap/optf/cmso/optimizer/DispatchedOptimizerList.java
cmso-service/src/main/java/org/onap/optf/cmso/ticketmgt/bean/TmApprovalStatusEnum.java
cmso-service/src/main/java/org/onap/optf/cmso/ticketmgt/bean/TmAsset.java
cmso-service/src/main/java/org/onap/optf/cmso/ticketmgt/bean/TmChangeInfo.java
cmso-service/src/main/java/org/onap/optf/cmso/ticketmgt/bean/TmStatusEnum.java
cmso-service/src/main/java/org/onap/optf/cmso/wf/bean/WfChangeManagementResponse.java
cmso-service/src/main/java/org/onap/optf/cmso/wf/bean/WfCmResponse200.java
cmso-service/src/main/java/org/onap/optf/cmso/wf/bean/WfMsoRequestReferences.java
cmso-service/src/main/java/org/onap/optf/cmso/wf/bean/WfMsoResponse.java
cmso-service/src/main/java/org/onap/optf/cmso/wf/bean/WfVidCmResponse.java
cmso-ticketmgt/pom.xml
cmso-ticketmgt/src/main/java/org/onap/observations/Observation.java
cmso-ticketmgt/src/main/java/org/onap/observations/ObservationInterface.java [deleted file]
cmso-ticketmgt/src/main/java/org/onap/observations/ObservationObject.java
cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/common/LogMessages.java
cmso-topology/pom.xml
cmso-topology/src/main/java/org/onap/observations/Observation.java
cmso-topology/src/main/java/org/onap/observations/ObservationInterface.java [deleted file]
cmso-topology/src/main/java/org/onap/observations/ObservationObject.java
cmso-topology/src/main/java/org/onap/optf/cmso/topology/common/LogMessages.java
pom.xml

index e3a581d..d8b67bf 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright Â© 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright Â© 2018 IBM.\r
  * \r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
index f63701e..2c646d8 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright Â© 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright Â© 2018 IBM.\r
  * \r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
diff --git a/cmso-logger/pom.xml b/cmso-logger/pom.xml
new file mode 100644 (file)
index 0000000..2665690
--- /dev/null
@@ -0,0 +1,57 @@
+<?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">
+    <parent>
+        <artifactId>cmso</artifactId>
+        <groupId>org.onap.optf.cmso</groupId>
+        <version>2.2.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>cmso-logger</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-core</artifactId>
+            <version>${log4j.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-api</artifactId>
+            <version>${log4j.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.att.eelf</groupId>
+            <artifactId>eelf-core</artifactId>
+            <version>${eelf.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.mockito</groupId>
+                    <artifactId>mockito-core</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.powermock</groupId>
+                    <artifactId>powermock-module</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.powermock</groupId>
+                    <artifactId>powermock-api-mockito</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.powermock</groupId>
+                    <artifactId>powermock-module-junit4</artifactId>
+                </exclusion>
+
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>javax.ws.rs-api</artifactId>
+            <version>${javax.version.rs.api}</version>
+        </dependency>
+    </dependencies>
+
+
+</project>
\ No newline at end of file
diff --git a/cmso-logger/src/main/java/org/onap/logger/Logger.java b/cmso-logger/src/main/java/org/onap/logger/Logger.java
new file mode 100644 (file)
index 0000000..602def3
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * Copyright © 2019 AT&T Intellectual Property.
+ * Modified 2020 Nokia.
+ *
+ * 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.
+ *
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *         https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * 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.
+ */
+package org.onap.logger;
+
+import com.att.eelf.configuration.EELFLogger;
+import org.apache.logging.log4j.spi.StandardLevel;
+import org.onap.observations.ObservationInterface;
+
+public class Logger {
+
+    private final EELFLogger log;
+    private final EELFLogger metrics;
+    private final EELFLogger audit;
+    private final EELFLogger errors;
+    private final EELFLogger debug;
+
+    public Logger(EELFLogger log, EELFLogger metrics, EELFLogger audit, EELFLogger errors, EELFLogger debug) {
+        this.log = log;
+        this.metrics = metrics;
+        this.audit = audit;
+        this.errors = errors;
+        this.debug = debug;
+    }
+
+    public void report(ObservationInterface obs, Exception except, String... arguments) {
+
+        if (obs.getAudit()) {
+            audit.info(obs, except, arguments);
+        }
+        if (obs.getMetric()) {
+            metrics.info(obs, except, arguments);
+        }
+
+        final StandardLevel standardLevel = obs.getLevel().getStandardLevel();
+
+        switch (standardLevel) {
+            case WARN:
+                errors.warn(obs, arguments);
+                debug.debug(obs, except, arguments);
+                break;
+            case INFO:
+                log.info(obs, except, arguments);
+                debug.debug(obs, except, arguments);
+                break;
+            case ERROR:
+                errors.error(obs, arguments);
+                debug.debug(obs, except, arguments);
+                break;
+            case TRACE:
+                debug.trace(obs, except, arguments);
+                break;
+            case DEBUG:
+                debug.debug(obs, except, arguments);
+                break;
+            default:
+                log.info(obs, except, arguments);
+        }
+
+    }
+
+    public void report(ObservationInterface obs, String... arguments) {
+
+        if (obs.getAudit()) {
+            audit.info(obs, arguments);
+        }
+        if (obs.getMetric()) {
+            metrics.info(obs, arguments);
+        }
+
+        final StandardLevel standardLevel = obs.getLevel().getStandardLevel();
+
+        switch (standardLevel) {
+            case WARN:
+                errors.warn(obs, arguments);
+                debug.debug(obs, arguments);
+                break;
+            case INFO:
+                log.info(obs, arguments);
+                debug.debug(obs, arguments);
+                break;
+            case ERROR:
+                errors.error(obs, arguments);
+                debug.debug(obs, arguments);
+                break;
+            case TRACE:
+                debug.debug(obs, arguments);
+                break;
+            case DEBUG:
+                debug.debug(obs, arguments);
+                break;
+            default:
+                log.info(obs, arguments);
+        }
+    }
+}
@@ -1,5 +1,6 @@
 /*
  * Copyright © 2019 AT&T Intellectual Property.
+ * Modified 2020 Nokia.
  *
  * 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
 
 package org.onap.observations;
 
-import com.att.eelf.i18n.EELFResolvableErrorEnum;
-import javax.ws.rs.core.Response.Status;
-import org.apache.log4j.Level;
-
-public interface ObservationInterface extends EELFResolvableErrorEnum {
-    public Enum<?> getValue();
-
-    public Level getLevel();
 
-    public String getMessage();
-
-    public Status getStatus();
-
-    public String getDomain();
+import com.att.eelf.i18n.EELFResolvableErrorEnum;
+import org.apache.logging.log4j.Level;
 
-    public String name();
+import static javax.ws.rs.core.Response.Status;
 
-    public Boolean getAudit();
+public interface ObservationInterface extends EELFResolvableErrorEnum {
 
-    public Boolean getMetric();
+    Enum<?> getValue();
+    Level getLevel();
+    String getMessage();
+    Status getStatus();
+    String getDomain();
+    String name();
+    Boolean getAudit();
+    Boolean getMetric();
 }
index bf6e3eb..a899f87 100644 (file)
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-context-support</artifactId>
                </dependency>
-               <dependency>
-                       <groupId>com.att.eelf</groupId>
-                       <artifactId>eelf-core</artifactId>
-                       <version>${eelf.version}</version>
-                       <exclusions>
-                               <exclusion>
-                                       <groupId>org.mockito</groupId>
-                                       <artifactId>mockito-core</artifactId>
-                               </exclusion>
-                               <exclusion>
-                                       <groupId>org.powermock</groupId>
-                                       <artifactId>powermock-module</artifactId>
-                               </exclusion>
-                               <exclusion>
-                                       <groupId>org.powermock</groupId>
-                                       <artifactId>powermock-api-mockito</artifactId>
-                               </exclusion>
-                               <exclusion>
-                                       <groupId>org.powermock</groupId>
-                                       <artifactId>powermock-module-junit4</artifactId>
-                               </exclusion>
-
-                       </exclusions>
-               </dependency>
                <dependency>
                        <groupId>org.yaml</groupId>
                        <artifactId>snakeyaml</artifactId>
 
                <!-- <dependency> <groupId>org.onap.aaf.authz</groupId> <artifactId>aaf-cadi-aaf</artifactId> 
                        <version>2.1.1</version> </dependency> -->
-               <dependency>
-                       <groupId>javax.ws.rs</groupId>
-                       <artifactId>javax.ws.rs-api</artifactId>
-                       <version>2.1</version>
-               </dependency>
 
                <!--Swagger Dependencies -->
                <dependency>
                        <groupId>org.onap.aaf.authz</groupId>
                        <artifactId>aaf-cadi-aaf</artifactId>
                        <version>${aaf.version}</version>
+                       <exclusions>
+                               <exclusion>
+                                       <groupId>log4j</groupId>
+                                       <artifactId>log4j</artifactId>
+                               </exclusion>
+                       </exclusions>
+               </dependency>
+               <dependency>
+                       <groupId>org.onap.optf.cmso</groupId>
+                       <artifactId>cmso-logger</artifactId>
+                       <version>2.2.0-SNAPSHOT</version>
                </dependency>
        </dependencies>
 
index e6aa29e..faba1df 100644 (file)
@@ -34,8 +34,8 @@ import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Paths;
 import javax.ws.rs.core.Response.Status;
-import org.apache.log4j.Level;
-import org.onap.optf.cmso.optimizer.observations.ObservationInterface;
+import org.apache.logging.log4j.Level;
+import org.onap.observations.ObservationInterface;
 
 /**
  * The Enum LogMessages.
index f780390..d2d1cc7 100644 (file)
@@ -30,8 +30,8 @@ import com.att.eelf.i18n.EELFResourceManager;
 import java.util.ArrayList;
 import java.util.List;
 import javax.ws.rs.core.Response.Status;
+import org.onap.observations.ObservationInterface;
 import org.onap.optf.cmso.optimizer.common.CmsoRequestError;
-import org.onap.optf.cmso.optimizer.observations.ObservationInterface;
 
 /**
  * The Class CMSException.
index 66834fa..e994d18 100644 (file)
@@ -38,10 +38,9 @@ import static com.att.eelf.configuration.Configuration.MDC_TARGET_ENTITY;
 import static com.att.eelf.configuration.Configuration.MDC_TARGET_SERVICE_NAME;
 
 import com.att.eelf.utils.Stopwatch;
-import java.net.URI;
-import java.util.Date;
-import java.util.Map;
-import java.util.UUID;
+import org.onap.observations.ObservationInterface;
+import org.onap.optf.cmso.optimizer.observations.MessageHeaders.HeadersEnum;
+import org.slf4j.MDC;
 import javax.servlet.http.HttpServletRequest;
 import javax.ws.rs.client.ClientRequestContext;
 import javax.ws.rs.client.ClientResponseContext;
@@ -49,8 +48,10 @@ import javax.ws.rs.container.ContainerRequestContext;
 import javax.ws.rs.container.ContainerResponseContext;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Response.StatusType;
-import org.onap.optf.cmso.optimizer.observations.MessageHeaders.HeadersEnum;
-import org.slf4j.MDC;
+import java.net.URI;
+import java.util.Date;
+import java.util.Map;
+import java.util.UUID;
 
 /**
  * EELF logging MDC fields not defined in the MDC Configuration (i.e. MDC_ALERT_SEVERITY)
index cb36e40..baedf3a 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright © 2019 AT&T Intellectual Property.
+ * Modified 2020 Nokia.
  *
  * 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
@@ -28,10 +29,10 @@ package org.onap.optf.cmso.optimizer.observations;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import org.apache.log4j.Level;
+import org.onap.logger.Logger;
+import org.onap.observations.ObservationInterface;
 import org.onap.optf.cmso.optimizer.Application;
 
-
 /**
  * The Class Observation.
  */
@@ -42,88 +43,36 @@ public class Observation {
     private static EELFLogger errors = EELFManager.getInstance().getErrorLogger();
     private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();
 
+    private static Logger logger = new Logger(log, metrics, audit, errors, debug);
+
+
     /**
      * Report.
      *
-     * @param obs the o
-     * @param execpt the e
+     * @param obs       the o
+     * @param except    the e
      * @param arguments the arguments
      */
     // *************************************************************************************************
-    public static void report(ObservationInterface obs, Exception execpt, String... arguments) {
+    public static void report(ObservationInterface obs, Exception except, String... arguments) {
         Mdc.setCaller(4);
         Mdc.setObservation(obs);
-        if (obs.getAudit()) {
-            audit.info(obs, execpt, arguments);
-        }
-        if (obs.getMetric()) {
-            metrics.info(obs, execpt, arguments);
-        }
-        Level lev = obs.getLevel();
-        switch (lev.toInt()) {
-            case Level.WARN_INT:
-                errors.warn(obs, arguments);
-                debug.debug(obs, execpt, arguments);
-                break;
-            case Level.INFO_INT:
-                log.info(obs, execpt, arguments);
-                debug.debug(obs, execpt, arguments);
-                break;
-            case Level.ERROR_INT:
-                errors.error(obs, arguments);
-                debug.debug(obs, execpt, arguments);
-                break;
-            case Level.TRACE_INT:
-                debug.trace(obs, execpt, arguments);
-                break;
-            case Level.DEBUG_INT:
-                debug.debug(obs, execpt, arguments);
-                break;
-            default:
-                log.info(obs, execpt, arguments);
-        }
+        logger.report(obs, except, arguments);
         Mdc.clearCaller();
     }
 
     /**
      * Report.
      *
-     * @param obs the o
+     * @param obs       the o
      * @param arguments the arguments
      */
     public static void report(ObservationInterface obs, String... arguments) {
         Mdc.setCaller(4);
         Mdc.setObservation(obs);
-        if (obs.getAudit()) {
-            audit.info(obs, arguments);
-        }
-        if (obs.getMetric()) {
-            metrics.info(obs, arguments);
-        }
-        Level levl = obs.getLevel();
-        switch (levl.toInt()) {
-            case Level.WARN_INT:
-                errors.warn(obs, arguments);
-                debug.debug(obs, arguments);
-                break;
-            case Level.INFO_INT:
-                log.info(obs, arguments);
-                debug.debug(obs, arguments);
-                break;
-            case Level.ERROR_INT:
-                errors.error(obs, arguments);
-                debug.debug(obs, arguments);
-                break;
-            case Level.TRACE_INT:
-                debug.debug(obs, arguments);
-                break;
-            case Level.DEBUG_INT:
-                debug.debug(obs, arguments);
-                break;
-            default:
-                log.info(obs, arguments);
-        }
+        logger.report(obs, arguments);
         Mdc.clearCaller();
     }
 
+
 }
diff --git a/cmso-optimizer/src/main/java/org/onap/optf/cmso/optimizer/observations/ObservationInterface.java b/cmso-optimizer/src/main/java/org/onap/optf/cmso/optimizer/observations/ObservationInterface.java
deleted file mode 100644 (file)
index 2b4ff58..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright © 2019 AT&T Intellectual Property.
- *
- * 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.
- *
- *
- * Unless otherwise specified, all documentation contained herein is licensed under the Creative
- * Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation 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.
- */
-
-package org.onap.optf.cmso.optimizer.observations;
-
-import com.att.eelf.i18n.EELFResolvableErrorEnum;
-import javax.ws.rs.core.Response.Status;
-import org.apache.log4j.Level;
-
-public interface ObservationInterface extends EELFResolvableErrorEnum {
-    public Enum<?> getValue();
-
-    public Level getLevel();
-
-    public String getMessage();
-
-    public Status getStatus();
-
-    public String getDomain();
-
-    public String name();
-
-    public Boolean getAudit();
-
-    public Boolean getMetric();
-}
index 60ba2a1..7d8ee69 100644 (file)
@@ -28,8 +28,9 @@ package org.onap.optf.cmso.optimizer.observations;
 
 import com.att.eelf.i18n.EELFResolvableErrorEnum;
 import com.att.eelf.i18n.EELFResourceManager;
+import org.apache.logging.log4j.Level;
+import org.onap.observations.ObservationInterface;
 import javax.ws.rs.core.Response.Status;
-import org.apache.log4j.Level;
 
 
 /**
index db8d37e..947a995 100644 (file)
                        <groupId>com.fasterxml.jackson.dataformat</groupId>\r
                        <artifactId>jackson-dataformat-yaml</artifactId>\r
                </dependency>\r
-               <dependency>\r
-                       <groupId>com.att.eelf</groupId>\r
-                       <artifactId>eelf-core</artifactId>\r
-                       <version>${eelf.version}</version>\r
-                       <exclusions>\r
-                               <exclusion>\r
-                                       <groupId>org.mockito</groupId>\r
-                                       <artifactId>mockito-core</artifactId>\r
-                               </exclusion>\r
-                               <exclusion>\r
-                                       <groupId>org.powermock</groupId>\r
-                                       <artifactId>powermock-module</artifactId>\r
-                               </exclusion>\r
-                               <exclusion>\r
-                                       <groupId>org.powermock</groupId>\r
-                                       <artifactId>powermock-api-mockito</artifactId>\r
-                               </exclusion>\r
-                               <exclusion>\r
-                                       <groupId>org.powermock</groupId>\r
-                                       <artifactId>powermock-module-junit4</artifactId>\r
-                               </exclusion>\r
-\r
-                       </exclusions>\r
-               </dependency>\r
                <dependency>\r
                        <groupId>org.yaml</groupId>\r
                        <artifactId>snakeyaml</artifactId>\r
                </dependency>\r
                <!-- <dependency> <groupId>org.onap.aaf.authz</groupId> <artifactId>aaf-cadi-aaf</artifactId> \r
                        <version>2.1.1</version> </dependency> -->\r
-               <dependency>\r
-                       <groupId>javax.ws.rs</groupId>\r
-                       <artifactId>javax.ws.rs-api</artifactId>\r
-                       <version>2.1</version>\r
-               </dependency>\r
 \r
                <!--Swagger Dependencies -->\r
                <dependency>\r
                        <groupId>org.onap.aaf.authz</groupId>\r
                        <artifactId>aaf-cadi-aaf</artifactId>\r
                        <version>${aaf.version}</version>\r
+                       <exclusions>\r
+                               <exclusion>\r
+                                       <groupId>log4j</groupId>\r
+                                       <artifactId>log4j</artifactId>\r
+                               </exclusion>\r
+                       </exclusions>\r
                </dependency>\r
-       </dependencies>\r
+        <dependency>\r
+            <groupId>org.onap.optf.cmso</groupId>\r
+            <artifactId>cmso-logger</artifactId>\r
+            <version>2.2.0-SNAPSHOT</version>\r
+        </dependency>\r
+    </dependencies>\r
 \r
        <build>\r
                <finalName>cmso-service</finalName>\r
index 3d2d176..a097345 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright © 2019 AT&T Intellectual Property.
+ * Modified 2020 Nokia.
  *
  * 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
@@ -28,7 +29,7 @@ package org.onap.observations;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import org.apache.log4j.Level;
+import org.onap.logger.Logger;
 import org.onap.optf.cmso.Application;
 
 
@@ -42,47 +43,21 @@ public class Observation {
     private static EELFLogger errors = EELFManager.getInstance().getErrorLogger();
     private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();
 
+    private static Logger logger = new Logger(log, metrics, audit, errors, debug);
+
     /**
      * Report.
      *
      * @param obs the o
-     * @param execpt the e
+     * @param except the e
      * @param arguments the arguments
      */
     // *************************************************************************************************
-    public static void report(ObservationInterface obs, Exception execpt, String... arguments) {
-        Mdc.setCaller(4);
-        Mdc.setObservation(obs);
-        if (obs.getAudit()) {
-            audit.info(obs, execpt, arguments);
-        }
-        if (obs.getMetric()) {
-            metrics.info(obs, execpt, arguments);
-        }
-        Level lev = obs.getLevel();
-        switch (lev.toInt()) {
-            case Level.WARN_INT:
-                errors.warn(obs, arguments);
-                debug.debug(obs, execpt, arguments);
-                break;
-            case Level.INFO_INT:
-                log.info(obs, execpt, arguments);
-                debug.debug(obs, execpt, arguments);
-                break;
-            case Level.ERROR_INT:
-                errors.error(obs, arguments);
-                debug.debug(obs, execpt, arguments);
-                break;
-            case Level.TRACE_INT:
-                debug.trace(obs, execpt, arguments);
-                break;
-            case Level.DEBUG_INT:
-                debug.debug(obs, execpt, arguments);
-                break;
-            default:
-                log.info(obs, execpt, arguments);
-        }
-        Mdc.clearCaller();
+    public static void report(ObservationInterface obs, Exception except, String... arguments) {
+       Mdc.setCaller(4);
+       Mdc.setObservation(obs);
+       logger.report(obs, except, arguments);
+       Mdc.clearCaller();
     }
 
     /**
@@ -94,35 +69,7 @@ public class Observation {
     public static void report(ObservationInterface obs, String... arguments) {
         Mdc.setCaller(4);
         Mdc.setObservation(obs);
-        if (obs.getAudit()) {
-            audit.info(obs, arguments);
-        }
-        if (obs.getMetric()) {
-            metrics.info(obs, arguments);
-        }
-        Level levl = obs.getLevel();
-        switch (levl.toInt()) {
-            case Level.WARN_INT:
-                errors.warn(obs, arguments);
-                debug.debug(obs, arguments);
-                break;
-            case Level.INFO_INT:
-                log.info(obs, arguments);
-                debug.debug(obs, arguments);
-                break;
-            case Level.ERROR_INT:
-                errors.error(obs, arguments);
-                debug.debug(obs, arguments);
-                break;
-            case Level.TRACE_INT:
-                debug.debug(obs, arguments);
-                break;
-            case Level.DEBUG_INT:
-                debug.debug(obs, arguments);
-                break;
-            default:
-                log.info(obs, arguments);
-        }
+        logger.report(obs, arguments);
         Mdc.clearCaller();
     }
 
index f1c1277..9ed1d84 100644 (file)
@@ -28,8 +28,9 @@ package org.onap.observations;
 
 import com.att.eelf.i18n.EELFResolvableErrorEnum;
 import com.att.eelf.i18n.EELFResourceManager;
+import org.apache.logging.log4j.Level;
+
 import javax.ws.rs.core.Response.Status;
-import org.apache.log4j.Level;
 
 
 /**
index cd6af4c..63e2b4a 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright Â© 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright Â© 2018 IBM.\r
  * \r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
index 3fd6cc8..6b6b544 100644 (file)
@@ -32,7 +32,7 @@ import java.io.IOException;
 import java.nio.file.Files;\r
 import java.nio.file.Paths;\r
 import javax.ws.rs.core.Response.Status;\r
-import org.apache.log4j.Level;\r
+import org.apache.logging.log4j.Level;\r
 import org.onap.observations.ObservationInterface;\r
 \r
 /**\r
index 871e831..c834614 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright Â© 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright Â© 2018 IBM.\r
  * \r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
index 9b004f9..7ae9df9 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright Â© 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright Â© 2018 IBM.\r
  * \r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
index ac2d9b8..0802ec1 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright Â© 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright Â© 2018 IBM.\r
  * \r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
index 03b031a..d6231e0 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright Â© 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright Â© 2018 IBM.\r
  * \r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
index dd480b0..0bbcc92 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright Â© 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright Â© 2018 IBM.\r
  * \r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
index cdf47f5..e2266b5 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright Â© 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright Â© 2018 IBM.\r
  * \r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
index 65f2bcc..72b082f 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright Â© 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright Â© 2018 IBM.\r
  * \r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
index 56743c3..334cc93 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright Â© 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright Â© 2018 IBM.\r
  * \r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
index 1876c93..c565390 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright Â© 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright Â© 2018 IBM.\r
  * \r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
index 395d99d..542c898 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright Â© 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright Â© 2018 IBM.\r
  * \r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
index 7ba9a83..6c68abb 100644 (file)
                                </exclusion>
                        </exclusions>
                </dependency>
-               <dependency>
-                       <groupId>com.att.eelf</groupId>
-                       <artifactId>eelf-core</artifactId>
-                       <version>${eelf.version}</version>
-                       <exclusions>
-                               <exclusion>
-                                       <groupId>org.mockito</groupId>
-                                       <artifactId>mockito-core</artifactId>
-                               </exclusion>
-                               <exclusion>
-                                       <groupId>org.powermock</groupId>
-                                       <artifactId>powermock-module</artifactId>
-                               </exclusion>
-                               <exclusion>
-                                       <groupId>org.powermock</groupId>
-                                       <artifactId>powermock-api-mockito</artifactId>
-                               </exclusion>
-                               <exclusion>
-                                       <groupId>org.powermock</groupId>
-                                       <artifactId>powermock-module-junit4</artifactId>
-                               </exclusion>
-
-                       </exclusions>
-               </dependency>
                <!-- <dependency> <groupId>org.onap.aaf.authz</groupId> <artifactId>aaf-cadi-aaf</artifactId> 
                        <version>2.1.1</version> </dependency> -->
-               <dependency>
-                       <groupId>javax.ws.rs</groupId>
-                       <artifactId>javax.ws.rs-api</artifactId>
-                       <version>2.1</version>
-               </dependency>
 
                <!--Swagger Dependencies -->
                <dependency>
                        <groupId>org.onap.aaf.authz</groupId>
                        <artifactId>aaf-cadi-aaf</artifactId>
                        <version>${aaf.version}</version>
+                       <exclusions>
+                               <exclusion>
+                                       <groupId>log4j</groupId>
+                                       <artifactId>log4j</artifactId>
+                               </exclusion>
+                       </exclusions>
+               </dependency>
+               <dependency>
+                       <groupId>org.onap.optf.cmso</groupId>
+                       <artifactId>cmso-logger</artifactId>
+                       <version>2.2.0-SNAPSHOT</version>
                </dependency>
        </dependencies>
 
index 8d053bf..23226ab 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright © 2019 AT&T Intellectual Property.
+ * Modified 2020 Nokia.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -32,7 +33,7 @@ package org.onap.observations;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import org.apache.log4j.Level;
+import org.onap.logger.Logger;
 
 
 public class Observation {
@@ -42,6 +43,8 @@ public class Observation {
     private static EELFLogger errors = EELFManager.getInstance().getErrorLogger();
     private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();
 
+    private static Logger logger = new Logger(log, metrics, audit, errors, debug);
+
     /**
      * Report.
      *
@@ -53,35 +56,7 @@ public class Observation {
     public static void report(ObservationInterface obs, Exception exc, String... arguments) {
         Mdc.setCaller(4);
         Mdc.setObservation(obs);
-        if (obs.getAudit()) {
-            audit.info(obs, exc, arguments);
-        }
-        if (obs.getMetric()) {
-            metrics.info(obs, exc, arguments);
-        }
-        Level lev = obs.getLevel();
-        switch (lev.toInt()) {
-            case Level.WARN_INT:
-                errors.warn(obs, arguments);
-                debug.debug(obs, exc, arguments);
-                break;
-            case Level.INFO_INT:
-                log.info(obs, exc, arguments);
-                debug.debug(obs, exc, arguments);
-                break;
-            case Level.ERROR_INT:
-                errors.error(obs, arguments);
-                debug.debug(obs, exc, arguments);
-                break;
-            case Level.TRACE_INT:
-                debug.trace(obs, exc, arguments);
-                break;
-            case Level.DEBUG_INT:
-                debug.debug(obs, exc, arguments);
-                break;
-            default:
-                log.info(obs, exc, arguments);
-        }
+        logger.report(obs, exc, arguments);
         Mdc.clearCaller();
     }
 
@@ -94,35 +69,7 @@ public class Observation {
     public static void report(ObservationInterface obs, String... arguments) {
         Mdc.setCaller(4);
         Mdc.setObservation(obs);
-        if (obs.getAudit()) {
-            audit.info(obs, arguments);
-        }
-        if (obs.getMetric()) {
-            metrics.info(obs, arguments);
-        }
-        Level lev = obs.getLevel();
-        switch (lev.toInt()) {
-            case Level.WARN_INT:
-                errors.warn(obs, arguments);
-                debug.debug(obs, arguments);
-                break;
-            case Level.INFO_INT:
-                log.info(obs, arguments);
-                debug.debug(obs, arguments);
-                break;
-            case Level.ERROR_INT:
-                errors.error(obs, arguments);
-                debug.debug(obs, arguments);
-                break;
-            case Level.TRACE_INT:
-                debug.debug(obs, arguments);
-                break;
-            case Level.DEBUG_INT:
-                debug.debug(obs, arguments);
-                break;
-            default:
-                log.info(obs, arguments);
-        }
+        logger.report(obs, arguments);
         Mdc.clearCaller();
     }
 
diff --git a/cmso-ticketmgt/src/main/java/org/onap/observations/ObservationInterface.java b/cmso-ticketmgt/src/main/java/org/onap/observations/ObservationInterface.java
deleted file mode 100644 (file)
index ebe657a..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright © 2019 AT&T Intellectual Property.
- *
- * 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.
- *
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *         https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * 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.
-*/
-
-package org.onap.observations;
-
-import com.att.eelf.i18n.EELFResolvableErrorEnum;
-import javax.ws.rs.core.Response.Status;
-import org.apache.log4j.Level;
-
-public interface ObservationInterface extends EELFResolvableErrorEnum {
-    public Enum<?> getValue();
-
-    public Level getLevel();
-
-    public String getMessage();
-
-    public Status getStatus();
-
-    public String getDomain();
-
-    public String name();
-
-    public Boolean getAudit();
-
-    public Boolean getMetric();
-}
index 8544047..3069dbe 100644 (file)
@@ -32,8 +32,9 @@ package org.onap.observations;
 
 import com.att.eelf.i18n.EELFResolvableErrorEnum;
 import com.att.eelf.i18n.EELFResourceManager;
+import org.apache.logging.log4j.Level;
+
 import javax.ws.rs.core.Response.Status;
-import org.apache.log4j.Level;
 
 
 public class ObservationObject implements ObservationInterface {
index 584c140..1f394a3 100644 (file)
@@ -38,7 +38,7 @@ import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Paths;
 import javax.ws.rs.core.Response.Status;
-import org.apache.log4j.Level;
+import org.apache.logging.log4j.Level;
 import org.onap.observations.ObservationInterface;
 
 public enum LogMessages implements ObservationInterface {
index 756d75b..deb6ecf 100644 (file)
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-context-support</artifactId>
                </dependency>
-               <dependency>
-                       <groupId>com.att.eelf</groupId>
-                       <artifactId>eelf-core</artifactId>
-                       <version>${eelf.version}</version>
-                       <exclusions>
-                               <exclusion>
-                                       <groupId>org.mockito</groupId>
-                                       <artifactId>mockito-core</artifactId>
-                               </exclusion>
-                               <exclusion>
-                                       <groupId>org.powermock</groupId>
-                                       <artifactId>powermock-module</artifactId>
-                               </exclusion>
-                               <exclusion>
-                                       <groupId>org.powermock</groupId>
-                                       <artifactId>powermock-api-mockito</artifactId>
-                               </exclusion>
-                               <exclusion>
-                                       <groupId>org.powermock</groupId>
-                                       <artifactId>powermock-module-junit4</artifactId>
-                               </exclusion>
-
-                       </exclusions>
-               </dependency>
                <dependency>
                        <groupId>org.yaml</groupId>
                        <artifactId>snakeyaml</artifactId>
                </dependency>
                <!-- <dependency> <groupId>org.onap.aaf.authz</groupId> <artifactId>aaf-cadi-aaf</artifactId> 
                        <version>2.1.1</version> </dependency> -->
-               <dependency>
-                       <groupId>javax.ws.rs</groupId>
-                       <artifactId>javax.ws.rs-api</artifactId>
-                       <version>2.1</version>
-               </dependency>
 
                <!--Swagger Dependencies -->
                <dependency>
                        <groupId>org.onap.aaf.authz</groupId>
                        <artifactId>aaf-cadi-aaf</artifactId>
                        <version>${aaf.version}</version>
+                       <exclusions>
+                               <exclusion>
+                                       <groupId>log4j</groupId>
+                                       <artifactId>log4j</artifactId>
+                               </exclusion>
+                       </exclusions>
+               </dependency>
+               <dependency>
+                       <groupId>org.onap.optf.cmso</groupId>
+                       <artifactId>cmso-logger</artifactId>
+                       <version>2.2.0-SNAPSHOT</version>
                </dependency>
        </dependencies>
 
index e1ec30c..fdb8b51 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright © 2019 AT&T Intellectual Property.
+ * Modified 2020 Nokia.
  *
  * 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
@@ -28,7 +29,7 @@ package org.onap.observations;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import org.apache.log4j.Level;
+import org.onap.logger.Logger;
 import org.onap.optf.cmso.topology.Application;
 
 
@@ -42,46 +43,20 @@ public class Observation {
     private static EELFLogger errors = EELFManager.getInstance().getErrorLogger();
     private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();
 
+    private static Logger logger = new Logger(log, metrics, audit, errors, debug);
+
     /**
      * Report.
      *
      * @param obs the o
-     * @param execpt the e
+     * @param except the e
      * @param arguments the arguments
      */
     // *************************************************************************************************
-    public static void report(ObservationInterface obs, Exception execpt, String... arguments) {
+    public static void report(ObservationInterface obs, Exception except, String... arguments) {
         Mdc.setCaller(4);
         Mdc.setObservation(obs);
-        if (obs.getAudit()) {
-            audit.info(obs, execpt, arguments);
-        }
-        if (obs.getMetric()) {
-            metrics.info(obs, execpt, arguments);
-        }
-        Level lev = obs.getLevel();
-        switch (lev.toInt()) {
-            case Level.WARN_INT:
-                errors.warn(obs, arguments);
-                debug.debug(obs, execpt, arguments);
-                break;
-            case Level.INFO_INT:
-                log.info(obs, execpt, arguments);
-                debug.debug(obs, execpt, arguments);
-                break;
-            case Level.ERROR_INT:
-                errors.error(obs, arguments);
-                debug.debug(obs, execpt, arguments);
-                break;
-            case Level.TRACE_INT:
-                debug.trace(obs, execpt, arguments);
-                break;
-            case Level.DEBUG_INT:
-                debug.debug(obs, execpt, arguments);
-                break;
-            default:
-                log.info(obs, execpt, arguments);
-        }
+        logger.report(obs, except, arguments);
         Mdc.clearCaller();
     }
 
@@ -94,35 +69,7 @@ public class Observation {
     public static void report(ObservationInterface obs, String... arguments) {
         Mdc.setCaller(4);
         Mdc.setObservation(obs);
-        if (obs.getAudit()) {
-            audit.info(obs, arguments);
-        }
-        if (obs.getMetric()) {
-            metrics.info(obs, arguments);
-        }
-        Level levl = obs.getLevel();
-        switch (levl.toInt()) {
-            case Level.WARN_INT:
-                errors.warn(obs, arguments);
-                debug.debug(obs, arguments);
-                break;
-            case Level.INFO_INT:
-                log.info(obs, arguments);
-                debug.debug(obs, arguments);
-                break;
-            case Level.ERROR_INT:
-                errors.error(obs, arguments);
-                debug.debug(obs, arguments);
-                break;
-            case Level.TRACE_INT:
-                debug.debug(obs, arguments);
-                break;
-            case Level.DEBUG_INT:
-                debug.debug(obs, arguments);
-                break;
-            default:
-                log.info(obs, arguments);
-        }
+        logger.report(obs, arguments);
         Mdc.clearCaller();
     }
 
diff --git a/cmso-topology/src/main/java/org/onap/observations/ObservationInterface.java b/cmso-topology/src/main/java/org/onap/observations/ObservationInterface.java
deleted file mode 100644 (file)
index 0dce93d..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright © 2019 AT&T Intellectual Property.
- *
- * 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.
- *
- *
- * Unless otherwise specified, all documentation contained herein is licensed under the Creative
- * Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation 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.
- */
-
-package org.onap.observations;
-
-import com.att.eelf.i18n.EELFResolvableErrorEnum;
-import javax.ws.rs.core.Response.Status;
-import org.apache.log4j.Level;
-
-public interface ObservationInterface extends EELFResolvableErrorEnum {
-    public Enum<?> getValue();
-
-    public Level getLevel();
-
-    public String getMessage();
-
-    public Status getStatus();
-
-    public String getDomain();
-
-    public String name();
-
-    public Boolean getAudit();
-
-    public Boolean getMetric();
-}
index f1c1277..fa93cb3 100644 (file)
@@ -28,8 +28,8 @@ package org.onap.observations;
 
 import com.att.eelf.i18n.EELFResolvableErrorEnum;
 import com.att.eelf.i18n.EELFResourceManager;
+import org.apache.logging.log4j.Level;
 import javax.ws.rs.core.Response.Status;
-import org.apache.log4j.Level;
 
 
 /**
index b5f1c0e..4386435 100644 (file)
@@ -34,7 +34,7 @@ import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Paths;
 import javax.ws.rs.core.Response.Status;
-import org.apache.log4j.Level;
+import org.apache.logging.log4j.Level;
 import org.onap.observations.ObservationInterface;
 
 public enum LogMessages implements ObservationInterface {
diff --git a/pom.xml b/pom.xml
index 0a723ef..1d0238c 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -71,6 +71,8 @@
                <eelf.version>1.0.0</eelf.version>
                <swagger.core.version>2.0.0</swagger.core.version>
                <aaf.version>2.1.4</aaf.version>
+               <log4j.version>2.13.1</log4j.version>
+               <javax.version.rs.api>2.1</javax.version.rs.api>
                <docker.push.registry>localhost:5000</docker.push.registry>
                <docker.pull.registry>nexus3.onap.org:10001</docker.pull.registry>
                <docker.http_proxy></docker.http_proxy>
@@ -96,7 +98,8 @@
         <module>cmso-ticketmgt</module>
         <module>cmso-robot</module>
                <module>cmso-sonar</module>
-    </modules>
+               <module>cmso-logger</module>
+       </modules>
 
        <build> 
                <pluginManagement>