aboutsummaryrefslogtreecommitdiffstats
path: root/common/src/main/java/org/onap/so/logger
diff options
context:
space:
mode:
authorSmokowski, Steve (ss835w) <ss835w@us.att.com>2018-09-20 11:04:00 -0400
committerSmokowski, Steve (ss835w) <ss835w@us.att.com>2018-09-20 11:08:27 -0400
commitc4347b25ddf03c4f8e25b9443e0e25be102d0ba6 (patch)
tree50602a362db32978814e185d84227634418215b1 /common/src/main/java/org/onap/so/logger
parent19659e205ef636cec767e32a62cc549cf9156d5b (diff)
Update Logging
Update logging to meet Casablanca Spec Change-Id: I029d6c63765992d6f091d96e2b4c34c60d30c484 Issue-ID: SO-947 Signed-off-by: Smokowski, Steve (ss835w) <ss835w@us.att.com>
Diffstat (limited to 'common/src/main/java/org/onap/so/logger')
-rw-r--r--common/src/main/java/org/onap/so/logger/LogConstants.java26
-rw-r--r--common/src/main/java/org/onap/so/logger/MsoLogger.java23
2 files changed, 27 insertions, 22 deletions
diff --git a/common/src/main/java/org/onap/so/logger/LogConstants.java b/common/src/main/java/org/onap/so/logger/LogConstants.java
new file mode 100644
index 0000000000..ea3c8e2c4a
--- /dev/null
+++ b/common/src/main/java/org/onap/so/logger/LogConstants.java
@@ -0,0 +1,26 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 ONAP - SO
+ * ================================================================================
+ * 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.onap.so.logger;
+
+public class LogConstants {
+ public static final String TARGET_ENTITY_HEADER="X-Target-Entity";
+ public static final String UNKNOWN_TARGET_ENTITY="Unknown-Target-Entity";
+}
diff --git a/common/src/main/java/org/onap/so/logger/MsoLogger.java b/common/src/main/java/org/onap/so/logger/MsoLogger.java
index 94ffa71169..c4fba671bb 100644
--- a/common/src/main/java/org/onap/so/logger/MsoLogger.java
+++ b/common/src/main/java/org/onap/so/logger/MsoLogger.java
@@ -207,30 +207,9 @@ public class MsoLogger {
private MsoLogger(MsoLogger.Catalog cat, Class<?> clazz) {
this.logger = LoggerFactory.getLogger(clazz);
this.auditLogger = LoggerFactory.getLogger("AUDIT");
- this.metricsLogger = LoggerFactory.getLogger("METRIC");
- MsoLogger.initialization();
+ this.metricsLogger = LoggerFactory.getLogger("METRIC");
setDefaultLogCatalog(cat);
}
-
- private static synchronized void initialization() {
- if (instanceUUID == null || ("").equals(instanceUUID)) {
- instanceUUID = getInstanceUUID();
- }
-
- if (serverIP == null || serverName == null || ("").equals(serverIP) || ("").equals(serverName)) {
- try {
- InetAddress server = InetAddress.getLocalHost();
- serverIP = server.getHostAddress();
- serverName = server.getHostName();
- } catch (UnknownHostException e) {
- initLOGGER.error("Could not get local hostname", e);
- serverIP = "";
- serverName = "";
- }
- }
- }
-
-
public static MsoLogger getMsoLogger(MsoLogger.Catalog cat, Class<?> clazz) {
return new MsoLogger(cat,clazz);