From 580141f7cf72d4a120722fc7b870dfc5c3017ced Mon Sep 17 00:00:00 2001 From: sebdet Date: Wed, 1 Apr 2020 00:00:37 +0200 Subject: Rework the logs Rework the logs so that it's easier to debug the issues on a lab Issue-ID: CLAMP-804 Signed-off-by: sebdet Change-Id: I9cff98205c2135a759e7e6156ab39f8af8129927 --- src/main/resources/META-INF/resources/swagger.html | 6 +- src/main/resources/application-noaaf.properties | 1 + src/main/resources/application.properties | 2 +- .../resources/clds/camel/rest/clamp-api-v2.xml | 435 +++++++++++++++------ src/main/resources/logback-default.xml | 103 +++-- src/main/resources/logback-spring.xml | 19 + src/main/resources/logback.xml | 19 - 7 files changed, 398 insertions(+), 187 deletions(-) create mode 100644 src/main/resources/logback-spring.xml delete mode 100644 src/main/resources/logback.xml (limited to 'src/main/resources') diff --git a/src/main/resources/META-INF/resources/swagger.html b/src/main/resources/META-INF/resources/swagger.html index 3f3ec6eb1..1f8cc9ebe 100644 --- a/src/main/resources/META-INF/resources/swagger.html +++ b/src/main/resources/META-INF/resources/swagger.html @@ -737,13 +737,13 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b

1.1. Version information

-

Version : 5.0.0-SNAPSHOT

+

Version : 5.0.2-SNAPSHOT

1.2. URI scheme

-

Host : localhost:46561
+

Host : localhost:34889
BasePath : /restservices/clds/
Schemes : HTTP

@@ -4344,7 +4344,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
diff --git a/src/main/resources/application-noaaf.properties b/src/main/resources/application-noaaf.properties index 4701b36df..d61b7ed53 100644 --- a/src/main/resources/application-noaaf.properties +++ b/src/main/resources/application-noaaf.properties @@ -81,6 +81,7 @@ server.tomcat.max-idle-time=60000 #Servlet context parameters server.context_parameters.p-name=value #context parameter with p-name as key and value as value. +camel.springboot.tracing=true camel.springboot.consumer-template-cache-size=1000 camel.springboot.producer-template-cache-size=1000 camel.springboot.jmx-enabled=true diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 5bf7910a2..3937d8fc2 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -85,7 +85,7 @@ server.tomcat.max-idle-time=60000 #Servlet context parameters server.context_parameters.p-name=value #context parameter with p-name as key and value as value. - +camel.springboot.tracing=true camel.springboot.consumer-template-cache-size=1000 camel.springboot.producer-template-cache-size=1000 camel.springboot.jmx-enabled=true diff --git a/src/main/resources/clds/camel/rest/clamp-api-v2.xml b/src/main/resources/clds/camel/rest/clamp-api-v2.xml index d81c164a5..e6741d6f8 100644 --- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml +++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml @@ -16,10 +16,19 @@ java.lang.Exception - false + true + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + + + + 500 + + + GET All Loop names FAILED + @@ -40,10 +49,19 @@ java.lang.Exception - false + true + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + + + + 500 + + + GET Loop FAILED + @@ -64,10 +82,19 @@ java.lang.Exception - false + true + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + + + + 500 + + + GET SVG For loop FAILED + @@ -96,10 +123,19 @@ java.lang.Exception - false + true + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + + + + 500 + + + UPDATE Global properties FAILED + @@ -127,10 +163,21 @@ java.lang.Exception - false + true + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + + + + + 500 + + + UPDATE Operational policies FAILED + @@ -161,10 +208,20 @@ java.lang.Exception - false + true + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + + + + 500 + + + UPDATE MicroService policy FAILED + @@ -195,14 +252,20 @@ java.lang.Exception - false + true + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + message="DEPLOY request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DEPLOY request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> + + 500 + + + DEPLOY request FAILED + @@ -230,14 +293,20 @@ java.lang.Exception - false + true + message="REFRESH json schema request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REFRESH Json schema request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> + + 500 + + + REFRESH json schema request FAILED + @@ -265,14 +334,20 @@ java.lang.Exception - false + true + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + message="REFRESH json schema request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REFRESH Json schema request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> + + 500 + + + REFRESH json schema request FAILED + @@ -302,14 +377,20 @@ java.lang.Exception - false + true + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + message="UNDEPLOY request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> + + 500 + + + UNDEPLOY request FAILED + @@ -339,14 +420,20 @@ java.lang.Exception - false + true + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + message="STOP request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> + + 500 + + + STOP request FAILED + @@ -377,14 +464,20 @@ java.lang.Exception - false + true + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + message="RESTART request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('RESTART request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> + + 500 + + + RESTART request FAILED + @@ -479,14 +572,20 @@ java.lang.Exception - false + true + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + message="SUBMIT request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> + + 500 + + + SUBMIT request FAILED + @@ -552,14 +651,20 @@ java.lang.Exception - false + true + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + message="DELETE request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> + + 500 + + + DELETE request FAILED + @@ -584,21 +689,27 @@ + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET STATUS request successfully executed','INFO',${exchangeProperty[loopObject]})" /> java.lang.Exception - false + true + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + message="GET STATUS request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET STATUS request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> + + 500 + + + GET STATUS request FAILED + @@ -627,14 +738,20 @@ java.lang.Exception - false + true + message="ADD operational policy request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> + + 500 + + + ADD Operational policy request FAILED + @@ -657,14 +774,20 @@ java.lang.Exception - false + true + message="REMOVE operational policy request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> + + 500 + + + REMOVE Operational policy request FAILED + @@ -691,14 +814,18 @@ true + + + 500 - - ERROR: ${exception.message} - - + + CREATE Loop from template FAILED + @@ -719,10 +846,18 @@ java.lang.Exception - false + true + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + + + 500 + + + GET Dictionary FAILED + @@ -744,10 +879,18 @@ java.lang.Exception - false + true + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + + + 500 + + + GET Dictionary FAILED + @@ -769,10 +912,18 @@ java.lang.Exception - false + true + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + + + 500 + + + GET Dictionary FAILED + @@ -796,10 +947,18 @@ java.lang.Exception - false + true + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + + + 500 + + + PUT Dictionary FAILED + @@ -826,10 +985,18 @@ java.lang.Exception - false + true + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + + + 500 + + + PUT Dictionary FAILED + @@ -850,10 +1017,18 @@ java.lang.Exception - false + true + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + + + 500 + + + DELETE Dictionary FAILED + @@ -876,10 +1051,18 @@ java.lang.Exception - false + true + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + + + 500 + + + DELETE Dictionary element FAILED + @@ -904,14 +1087,16 @@ true + + 500 - - ERROR: ${exception.message} - - + + GET Policy models FAILED + @@ -936,14 +1121,16 @@ true + + 500 - - ERROR: ${exception.message} - - + + GET Policy model FAILED + @@ -967,14 +1154,16 @@ true + + 500 - - ERROR: ${exception.message} - - + + GET Policy model YAML FAILED + @@ -1003,14 +1192,16 @@ true + + - 404 + 500 - - ERROR: ${exception.message} - - + + POST Policy model YAML FAILED + @@ -1039,14 +1230,16 @@ true - - 404 - - - ERROR: ${exception.message} - + + + 500 + + + MODIFY Policy model YAML FAILED + @@ -1071,14 +1264,16 @@ true + + 500 - - ERROR: ${exception.message} - - + + GET ALL templates FAILED + @@ -1103,14 +1298,16 @@ true + + 500 - - ERROR: ${exception.message} - - + + GET Template FAILED + @@ -1131,10 +1328,18 @@ java.lang.Exception - false + true + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + + + 500 + + + GET All Template names FAILED + @@ -1155,10 +1360,18 @@ java.lang.Exception - false + true + + + 500 + + + GET SVG for Template FAILED + diff --git a/src/main/resources/logback-default.xml b/src/main/resources/logback-default.xml index 4c496716c..a91f9576b 100644 --- a/src/main/resources/logback-default.xml +++ b/src/main/resources/logback-default.xml @@ -58,16 +58,12 @@ - ${outputDirectory}/clamp/error.%d{yyyy-MM-dd}.%i.log.zip + ${logDirectory}/error.%d{yyyy-MM-dd}.%i.log.zip 50MB - 30 - 10GB + 20 + 1GB - - 10MB - - ${outputDirectory}/clamp/debug.%d{yyyy-MM-dd}.%i.log.zip + ${logDirectory}/debug.%d{yyyy-MM-dd}.%i.log.zip 50MB - 30 - 10GB + 20 + 1GB @@ -100,15 +96,13 @@ - 10 - ${logDirectory}/audit.%i.log.zip + class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> + ${logDirectory}/audit.%d{yyyy-MM-dd}.%i.log.zip + 50MB + 20 + 1GB - - 10MB - - 10 - ${logDirectory}/metric.%i.log.zip + class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> + ${logDirectory}/metric.%d{yyyy-MM-dd}.%i.log.zip + 50MB + 20 + 1GB - - 10MB - + @@ -155,16 +148,15 @@ - 10 - ${logDirectory}/security.%i.log.zip + class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> + ${logDirectory}/security.%d{yyyy-MM-dd}.%i.log.zip + 50MB + 20 + 1GB - - 10MB - + @@ -177,39 +169,34 @@ class="ch.qos.logback.core.rolling.RollingFileAppender"> - ${logDirectory}/Audit-${lrmRVer}-${lrmRO}-${Pid}.log + ${logDirectory}/Audits.log - ${logDirectory}/Audit-${lrmRVer}-${lrmRO}-${Pid}.%i.log.zip + class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> + ${logDirectory}/Audits-%d{yyyy-MM-dd}.%i.log.zip - 1 - 9 + 50MB + 20 + 1GB - - 5MB - "%d [%thread] %-5level %logger{1024} - %msg%n" + - ${logDirectory}/Perform-${lrmRVer}-${lrmRO}-${Pid}.log + ${logDirectory}/Perform.log - ${logDirectory}/Perform-${lrmRVer}-${lrmRO}-${Pid}.%i.log.zip + class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> + ${logDirectory}/Perform--%d{yyyy-MM-dd}.%i.log.zip - 1 - 9 + 50MB + 20 + 1GB - - 5MB - "%d [%thread] %-5level %logger{1024} - %msg%n" @@ -220,19 +207,30 @@ level="DEBUG"> + + + + + + + + level="INFO"> + level="INFO"> - + @@ -240,7 +238,6 @@ - diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml new file mode 100644 index 000000000..ffa497f1d --- /dev/null +++ b/src/main/resources/logback-spring.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml deleted file mode 100644 index ffa497f1d..000000000 --- a/src/main/resources/logback.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file -- cgit 1.2.3-korg