summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/application/src
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2019-10-14 19:14:21 +0000
committerGerrit Code Review <gerrit@onap.org>2019-10-14 19:14:21 +0000
commiteed407003be0586fd93d8bced4daa32975a24794 (patch)
treec8098365d693ef648d43b17fd937ce499ae4dd54 /ms/blueprintsprocessor/application/src
parentcf31e364e6f6331528503d26f9f296103e4ff076 (diff)
parentd48433deac84f774c730bf4edbb2be50804f99c5 (diff)
Merge "Add reactive log tracing service."
Diffstat (limited to 'ms/blueprintsprocessor/application/src')
-rw-r--r--ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/LoggingWebFilter.kt39
-rwxr-xr-xms/blueprintsprocessor/application/src/main/resources/application-dev.properties2
-rw-r--r--ms/blueprintsprocessor/application/src/main/resources/logback.xml7
3 files changed, 46 insertions, 2 deletions
diff --git a/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/LoggingWebFilter.kt b/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/LoggingWebFilter.kt
new file mode 100644
index 000000000..5ed5ff450
--- /dev/null
+++ b/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/LoggingWebFilter.kt
@@ -0,0 +1,39 @@
+/*
+ * Copyright © 2018-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.
+ */
+
+package org.onap.ccsdk.cds.blueprintsprocessor
+
+import org.onap.ccsdk.cds.blueprintsprocessor.core.service.LoggingService
+import org.onap.ccsdk.cds.controllerblueprints.core.MDCContext
+import org.springframework.stereotype.Component
+import org.springframework.web.server.ServerWebExchange
+import org.springframework.web.server.WebFilter
+import org.springframework.web.server.WebFilterChain
+import reactor.core.publisher.Mono
+import reactor.util.context.Context
+
+@Component
+open class LoggingWebFilter : WebFilter {
+ override fun filter(serverWebExchange: ServerWebExchange, webFilterChain: WebFilterChain): Mono<Void> {
+
+ val loggingService = LoggingService()
+ loggingService.entering(serverWebExchange.request)
+ val filterChain = webFilterChain.filter(serverWebExchange).subscriberContext(
+ Context.of(MDCContext, MDCContext()))
+ loggingService.exiting(serverWebExchange.request, serverWebExchange.response)
+ return filterChain
+ }
+} \ No newline at end of file
diff --git a/ms/blueprintsprocessor/application/src/main/resources/application-dev.properties b/ms/blueprintsprocessor/application/src/main/resources/application-dev.properties
index e40ccba09..faabb80e7 100755
--- a/ms/blueprintsprocessor/application/src/main/resources/application-dev.properties
+++ b/ms/blueprintsprocessor/application/src/main/resources/application-dev.properties
@@ -36,7 +36,7 @@ blueprintsprocessor.blueprintArchivePath=blueprints/archive
blueprintsprocessor.blueprintWorkingPath=blueprints/work
# Controller Blueprint Load Configurations
# blueprints.load.initial-data may be overridden by ENV variables
-blueprintsprocessor.loadInitialData=true
+blueprintsprocessor.loadInitialData=false
blueprintsprocessor.loadBluePrint=false
blueprintsprocessor.loadBluePrintPaths=./../../../components/model-catalog/blueprint-model/service-blueprint
blueprintsprocessor.loadModelType=true
diff --git a/ms/blueprintsprocessor/application/src/main/resources/logback.xml b/ms/blueprintsprocessor/application/src/main/resources/logback.xml
index 6f917096d..9d2b82f25 100644
--- a/ms/blueprintsprocessor/application/src/main/resources/logback.xml
+++ b/ms/blueprintsprocessor/application/src/main/resources/logback.xml
@@ -15,11 +15,16 @@
-->
<configuration>
+
+ <property name="localPattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n"/>
+ <property name="defaultPattern"
+ value="%date{ISO8601,UTC}|%X{RequestID}|%X{InvocationID}|%thread|%X{ServiceName}|%X{ClientIPAddress}|%logger{50}| %msg%n"/>
+
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
- <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+ <pattern>${defaultPattern}</pattern>
</encoder>
</appender>
an> limitations under the License. ============LICENSE_END========================================================= --> <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> <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> <version>1.5.1-SNAPSHOT</version> </parent> <artifactId>api-active-standby-management</artifactId> <name>api-active-standby-management</name> <description>API for Active Standby Management feature</description> <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties> <dependencies> <dependency> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>policy-management</artifactId> <version>${project.version}</version> <scope>provided</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-checkstyle-plugin</artifactId> <executions> <execution> <id>onap-java-style</id> <goals> <goal>check</goal> </goals> <phase>process-sources</phase> <configuration> <!-- Use Google Java Style Guide: https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml with minor changes --> <configLocation>onap-checkstyle/onap-java-style.xml</configLocation> <!-- <sourceDirectory> is needed so that checkstyle ignores the generated sources directory --> <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory> <includeResources>true</includeResources> <includeTestSourceDirectory>true</includeTestSourceDirectory> <includeTestResources>true</includeTestResources> <excludes> </excludes> <suppressionsLocation>${project.baseUri}checkstyle-suppressions.xml</suppressionsLocation> <consoleOutput>true</consoleOutput> <failsOnViolation>true</failsOnViolation> <violationSeverity>warning</violationSeverity> </configuration> </execution> </executions> <dependencies> <dependency> <groupId>org.onap.oparent</groupId> <artifactId>checkstyle</artifactId> <version>${oparent.version}</version> <scope>compile</scope> </dependency> </dependencies> </plugin> </plugins> </build> </project>