Client Logging

Update Client Logging to use interceptor
Move CXF to own project due to dependency hell

Issue-ID: SO-947

Change-Id: I2597ff6d32231b8625b04ef63ab5e8f589e2545c
Signed-off-by: Smokowski, Steve (ss835w) <ss835w@us.att.com>
diff --git a/common/src/test/resources/logback-test.xml b/common/src/test/resources/logback-test.xml
index c4248bf..772eeab 100644
--- a/common/src/test/resources/logback-test.xml
+++ b/common/src/test/resources/logback-test.xml
@@ -1,8 +1,8 @@
 <!--
   ============LICENSE_START=======================================================
-  ECOMP MSO
+  ONAP SO
   ================================================================================
-  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+  Copyright (C) 2018 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.
@@ -18,159 +18,58 @@
   ============LICENSE_END=========================================================
   -->
 
-<configuration scan="false" debug="true">
-  <!--<jmxConfigurator /> -->
-  <!-- directory path for all other type logs -->
+<configuration>
+	<property name="p_tim" value="%d{&quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;, UTC}"/>
+    <property name="p_lvl" value="%level"/>
+    <property name="p_log" value="%logger"/>
+    <property name="p_mdc" value="%replace(%replace(%mdc){'\t','\\\\t'}){'\n', '\\\\n'}"/>
+    <property name="p_msg" value="%replace(%replace(%msg){'\t', '\\\\t'}){'\n','\\\\n'}"/>
+    <property name="p_exc" value="%replace(%replace(%rootException){'\t', '\\\\t'}){'\n','\\\\n'}"/>
+    <property name="p_mak" value="%replace(%replace(%marker){'\t', '\\\\t'}){'\n','\\\\n'}"/>
+    <property name="p_thr" value="%thread"/>
+    <property name="pattern" value="%nopexception${p_tim}\t${p_thr}\t${p_lvl}\t${p_log}\t${p_mdc}\t${p_msg}\t${p_exc}\t${p_mak}\t%n"/>
 
-  <property name="logDir" value="./target" />
-  
-  <!-- directory path for debugging type logs -->
-  <property name="debugDir" value="./target" />
-  
-  <!--  specify the component name 
-    <ECOMP-component-name>::= "MSO" | "DCAE" | "ASDC " | "AAI" |"Policy" | "SDNC" | "AC"  -->
-  <property name="componentName" value="MSO"></property>
-  <property name="subComponentName" value="Test"></property>
-  <!--  log file names -->
-  <property name="errorLogName" value="error" />
-  <property name="metricsLogName" value="metrics" />
-  <property name="auditLogName" value="audit" />
-  <property name="debugLogName" value="debug" />
 
-  <property name="errorPattern" value="%d{&quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;, UTC}|%X{RequestId}|%thread|%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%.-5level|%X{ErrorCode}|%X{ErrorDesc}|%msg%n" />
-  <property name="debugPattern" value="%d{&quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;, UTC}|%X{RequestId}|%msg%n" />
-
-  <property name="auditPattern" value="%X{BeginTimestamp}|%X{EndTimestamp}|%X{RequestId}|%X{ServiceInstanceId}|%thread||%X{ServiceName}|%X{PartnerName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDesc}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{Timer}|%X{ServerFQDN}|%X{RemoteHost}||||||||%msg%n" />
-  <property name="metricPattern" value="%X{BeginTimestamp}|%X{EndTimestamp}|%X{RequestId}|%X{ServiceInstanceId}|%thread||%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDesc}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{Timer}|%X{ServerFQDN}|%X{RemoteHost}||||%X{TargetVirtualEntity}|||||%msg%n" />
-
-  <property name="logDirectory" value="${logDir}/${componentName}/${subComponentName}" />
-  <property name="debugLogDirectory" value="${debugDir}/${componentName}/${subComponentName}" />
-
-  <appender name="test" class="org.onap.so.utils.TestAppender"/>
-  <!-- ============================================================================ -->
-  <!-- EELF Appenders -->
-  <!-- ============================================================================ -->
-
-  <!-- The EELFAppender is used to record events to the general application 
-    log -->
-  
-  <!-- EELF Audit Appender. This appender is used to record audit engine 
-    related logging events. The audit logger and appender are specializations 
-    of the EELF application root logger and appender. This can be used to segregate 
-    Policy engine events from other components, or it can be eliminated to record 
-    these events as part of the application root log. -->
-    
-  <appender name="EELFAudit"
-    class="ch.qos.logback.core.rolling.RollingFileAppender">
-    <file>${logDirectory}/${auditLogName}${jboss.server.name}.log</file>
-    <rollingPolicy
-      class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-      <fileNamePattern>${logDirectory}/${auditLogName}${jboss.server.name}.log.%d</fileNamePattern>
-      <!--<maxHistory>30</maxHistory>-->
-    </rollingPolicy>
-    <encoder>
-         <pattern>${auditPattern}</pattern>
-    </encoder>
-  </appender>
-  <appender name="asyncEELFAudit" class="ch.qos.logback.classic.AsyncAppender">
-    <queueSize>500</queueSize>
-    <discardingThreshold>0</discardingThreshold>
-    <appender-ref ref="EELFAudit" />
-  </appender>
-
-<appender name="EELFMetrics"
-    class="ch.qos.logback.core.rolling.RollingFileAppender">
-    <file>${logDirectory}/${metricsLogName}${jboss.server.name}.log</file>
-    <rollingPolicy
-      class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-      <fileNamePattern>${logDirectory}/${metricsLogName}${jboss.server.name}.log.%d</fileNamePattern>
-      <!--<maxHistory>30</maxHistory>-->
-    </rollingPolicy>
-    <encoder>
-      <!-- <pattern>"%d{HH:mm:ss.SSS} [%thread] %-5level %logger{1024} - 
-        %msg%n"</pattern> -->
-      <pattern>${metricPattern}</pattern>
-    </encoder>
-  </appender>
-  
-  
-  <appender name="asyncEELFMetrics" class="ch.qos.logback.classic.AsyncAppender">
-    <queueSize>500</queueSize>
-    <discardingThreshold>0</discardingThreshold>
-    <appender-ref ref="EELFMetrics"/>
-  </appender>
-   
-  <appender name="EELFError"
-    class="ch.qos.logback.core.rolling.RollingFileAppender">
-    <file>${logDirectory}/${errorLogName}${jboss.server.name}.log</file>
-    <rollingPolicy
-      class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-      <fileNamePattern>${logDirectory}/${errorLogName}${jboss.server.name}.log.%d</fileNamePattern>
-      <!--<maxHistory>30</maxHistory>-->
-    </rollingPolicy>
-    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
-      <level>INFO</level>
-    </filter>
-    <encoder>
-      <pattern>${errorPattern}</pattern>
-    </encoder>
-  </appender>
-  
-  <appender name="asyncEELFError" class="ch.qos.logback.classic.AsyncAppender">
-    <queueSize>500</queueSize>
-    <discardingThreshold>0</discardingThreshold>
-    <appender-ref ref="EELFError"/>
-  </appender>
-  
-   <appender name="EELFDebug"
-    class="ch.qos.logback.core.rolling.RollingFileAppender">
-    <file>${debugLogDirectory}/${debugLogName}${jboss.server.name}.log</file>
-    <rollingPolicy
-      class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-      <fileNamePattern>${debugLogDirectory}/${debugLogName}${jboss.server.name}.log.%d</fileNamePattern>
-      <!--<maxHistory>30</maxHistory>-->
-    </rollingPolicy>
-    <encoder>
-      <pattern>${debugPattern}</pattern>
-    </encoder>
-  </appender>
-  
-  <appender name="asyncEELFDebug" class="ch.qos.logback.classic.AsyncAppender">
-    <queueSize>500</queueSize>
-    <discardingThreshold>0</discardingThreshold>
-    <appender-ref ref="EELFDebug" />
-    <includeCallerData>true</includeCallerData>
-  </appender>
- 
-  	<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+	<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
 		<encoder>
-			<pattern>%d{HH:mm:ss.SSS} [%thread] |%X{RequestId}| %-5level
-				%logger{1024} - %msg%n
-			</pattern>
+			<pattern>${pattern}</pattern>
 		</encoder>
 	</appender>
+
+	<appender name="test"
+		class="org.onap.so.utils.TestAppender" />
+
+	<logger name="com.att.ecomp.audit" level="info" additivity="false">
+		<appender-ref ref="STDOUT" />
+	</logger>
+
+	<logger name="com.att.eelf.metrics" level="info" additivity="false">
+		<appender-ref ref="STDOUT" />
+	</logger>
+
+	<logger name="com.att.eelf.error" level="WARN" additivity="false">
+		<appender-ref ref="STDOUT" />
+	</logger>
+
+	<logger name="org.onap" level="${so.log.level:-DEBUG}" additivity="false">
+		<appender-ref ref="STDOUT" />
+		<appender-ref ref="test" />
+	</logger>
 	
-  <!-- ============================================================================ -->
-  <!--  EELF loggers -->
-  <!-- ============================================================================ -->
+	<logger name="org.flywaydb" level="DEBUG" additivity="false">
+        <appender-ref ref="STDOUT" />
+    </logger>
+	
 
-  <logger name="com.att.eelf.audit" level="${so.log.level:-DEBUG}" additivity="false">
-    <appender-ref ref="asyncEELFAudit" /> 
-  </logger>
-  
-  <logger name="METRIC" level="${so.log.level:-DEBUG}" additivity="true">
-    <appender-ref ref="asyncEELFMetrics" />
-    <appender-ref ref="test" />
-  </logger>
+	<logger name="ch.vorburger" level="WARN" additivity="false">
+		<appender-ref ref="STDOUT" />
+	</logger>
+	
 
-  <logger name="com.att.eelf.error" level="${so.log.level:-DEBUG}" additivity="false">
-    <appender-ref ref="asyncEELFError" />
-  </logger>
-  
-  <root level="${so.log.level:-DEBUG}">
-    <appender-ref ref="asyncEELFDebug" />
-    <appender-ref ref="STDOUT" />
-  </root>
+	<root level="WARN">
+		<appender-ref ref="STDOUT" />
+		<appender-ref ref="test" />
+	</root>
 
 
 </configuration>
\ No newline at end of file
diff --git a/common/src/test/resources/mso-bad.json b/common/src/test/resources/mso-bad.json
deleted file mode 100644
index 1aaea50..0000000
--- a/common/src/test/resources/mso-bad.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-	"asdc-connections": {
-		"asdc-controller1": {
-			"asdcUser": "user1",
-			"asdcConsumerGroup": "consumer1",
-			"asdcConsumerId": "consumer1",
-			"asdcEnvironmentName": "PROD",
-			"asdcAddress": "localhost:8443",
-			"asdcPassword": "1c551b8b5ab91fcd5a0907b11c304199"
-		},
-		"asdc-controller2": {
-			"asdcUser": "user2",
-			"asdcConsumerGroup": "consumer2",
-			"asdcConsumerId": "consumer2",
-			"asdcEnvironmentName": "E2E",
-			"asdcAddress": "localhost:8443",
-			"asdcPassword": "1c551b8b5ab91fcd5a0907b11c304199"
-		}
-	}
-}
\ No newline at end of file
diff --git a/common/src/test/resources/mso.json b/common/src/test/resources/mso.json
deleted file mode 100644
index e8ee4a9..0000000
--- a/common/src/test/resources/mso.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
-  "asdc-connections":{
-    "asdc-controller1":{
-        "asdcUser": "user1",
-        "asdcConsumerGroup": "consumer1",
-        "asdcConsumerId": "consumer1",
-        "asdcEnvironmentName": "PROD",
-        "asdcAddress": "localhost:8443",
-        "asdcPassword": "1c551b8b5ab91fcd5a0907b11c304199"
-    },
-    "asdc-controller2":{
-        "asdcUser": "user2",
-        "asdcConsumerGroup": "consumer2",
-        "asdcConsumerId": "consumer2",
-        "asdcEnvironmentName": "E2E",
-        "asdcAddress": "localhost:8443",
-        "asdcPassword": "1c551b8b5ab91fcd5a0907b11c304199"
-    }
-  },
-  "mso.properties.reload.time.minutes":2
-}
diff --git a/common/src/test/resources/mso.properties b/common/src/test/resources/mso.properties
deleted file mode 100644
index bb0e4eb..0000000
--- a/common/src/test/resources/mso.properties
+++ /dev/null
@@ -1,28 +0,0 @@
-###
-# ============LICENSE_START=======================================================
-# ECOMP MSO
-# ================================================================================
-# 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=========================================================
-###
-
-mso.properties.reload.time.minutes=2
-ecomp.mso.cloud.1.cloudId=MT
-ecomp.mso.cloud.1.keystoneUrl=http://localhost:5000/v2.0
-ecomp.mso.cloud.1.msoId=John
-ecomp.mso.cloud.1.publicNetId=FD205490A48D48475607C36B9AD902BF
-ecomp.mso.cloud.1.test=1234
-ecomp.mso.cloud.1.boolean=true
-ecomp.mso.cloud.1.enum=enum1
diff --git a/common/src/test/resources/mso2.json b/common/src/test/resources/mso2.json
deleted file mode 100644
index bac30c4..0000000
--- a/common/src/test/resources/mso2.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-	"asdc-connections": {
-		"asdc-controller1": {
-			"asdcUser": "user1B",
-			"asdcConsumerGroup": "consumer1",
-			"asdcConsumerId": "consumer1",
-			"asdcEnvironmentName": "PROD",
-			"asdcAddress": "localhost:8443",
-			"asdcPassword": "1c551b8b5ab91fcd5a0907b11c304199"
-		},
-		"asdc-controller2": {
-			"asdcUser": "user2B",
-			"asdcConsumerGroup": "consumer2",
-			"asdcConsumerId": "consumer2",
-			"asdcEnvironmentName": "E2E",
-			"asdcAddress": "localhost:8443",
-			"asdcPassword": "1c551b8b5ab91fcd5a0907b11c304199"
-		}
-	}
-}
\ No newline at end of file
diff --git a/common/src/test/resources/mso2.properties b/common/src/test/resources/mso2.properties
deleted file mode 100644
index 423346e..0000000
--- a/common/src/test/resources/mso2.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-###
-# ============LICENSE_START=======================================================
-# ECOMP MSO
-# ================================================================================
-# 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=========================================================
-###
-
-mso.properties.reload.time.minutes=1
-ecomp.mso.cloud.1.cloudId=MT2