From: sebdet Date: Fri, 3 May 2019 12:32:53 +0000 (+0200) Subject: Fix log reporting X-Git-Tag: 4.0.1~19^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=clamp.git;a=commitdiff_plain;h=584cc4a3f093edc5cdbdff0dcb5dcbe8457e197d Fix log reporting Fix loop log reported in UI, in case of failure it's not working correclty Issue-ID: CLAMP-360 Change-Id: I4533c650134b254619523d8c9cfe2791e9b6584b Signed-off-by: sebdet --- diff --git a/extra/sql/bulkload/create-tables.sql b/extra/sql/bulkload/create-tables.sql index 3c261eb4..da39ca5f 100644 --- a/extra/sql/bulkload/create-tables.sql +++ b/extra/sql/bulkload/create-tables.sql @@ -9,7 +9,7 @@ id bigint not null, log_instant datetime(6) not null, log_type varchar(255) not null, - message varchar(255) not null, + message MEDIUMTEXT not null, loop_id varchar(255) not null, primary key (id) ) engine=InnoDB; diff --git a/src/main/java/org/onap/clamp/loop/log/LoopLog.java b/src/main/java/org/onap/clamp/loop/log/LoopLog.java index 3edb2ee5..cea49571 100644 --- a/src/main/java/org/onap/clamp/loop/log/LoopLog.java +++ b/src/main/java/org/onap/clamp/loop/log/LoopLog.java @@ -69,7 +69,7 @@ public class LoopLog implements Serializable { private LogType logType; @Expose - @Column(name = "message", nullable = false) + @Column(name = "message", columnDefinition = "MEDIUMTEXT", nullable = false) private String message; @ManyToOne(fetch = FetchType.LAZY) 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 5c5f122c..4c1cd812 100644 --- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml +++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml @@ -286,7 +286,7 @@ loggingLevel="ERROR" message="STOP request failed for loop: $${header.loopName}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" /> @@ -331,7 +331,7 @@ loggingLevel="ERROR" message="START request failed for loop: ${header.loopName}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('START request failed, Error reported: ${exception}','INFO',${exchangeProperty[loopObject]})" /> @@ -439,7 +439,7 @@ loggingLevel="ERROR" message="SUBMIT request failed for loop: ${header.loopName}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" /> @@ -521,7 +521,7 @@ loggingLevel="ERROR" message="DELETE request failed for loop: ${header.loopName}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" /> diff --git a/src/main/resources/clds/camel/routes/flexible-flow.xml b/src/main/resources/clds/camel/routes/flexible-flow.xml index 75341de9..1ae6e3d9 100644 --- a/src/main/resources/clds/camel/routes/flexible-flow.xml +++ b/src/main/resources/clds/camel/routes/flexible-flow.xml @@ -478,8 +478,7 @@ false - ${exchangeProperty[policyName]} PDP Group removal status - + PDP Group removal, Error reported: ${exception} @@ -500,7 +499,8 @@ + + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}','INFO',${exchangeProperty[loopObject]})" /> \ No newline at end of file