Platform Operations, Administration, and Management (OA&M) Release Notes
========================================================================
+Version 2.0.7, 07 February 2019
+-------------------------------
+* Add implementation for mandatory MDC default value in logging POC and bump ELK stack version to 2.0.7(`ACUMOS-2458 <https://jira.acumos.org/browse/ACUMOS-2458>`_)
+
Version 2.0.4, 24 January 2019
-------------------------------
* Update logstash queries for database version 2.0.4 (`ACUMOS-2403 <https://jira.acumos.org/browse/ACUMOS-2403>`_)
<!-- docker image name -->
<artifactId>acumos-elasticsearch</artifactId>
<!-- docker tag -->
- <version>2.0.4-SNAPSHOT</version>
+ <version>2.0.7-SNAPSHOT</version>
</project>
<!-- docker image name -->
<artifactId>acumos-kibana</artifactId>
<!-- docker tag -->
- <version>2.0.4-SNAPSHOT</version>
+ <version>2.0.7-SNAPSHOT</version>
</project>
<!-- docker image name -->
<artifactId>acumos-logstash</artifactId>
<!-- docker tag -->
- <version>2.0.4-SNAPSHOT</version>
+ <version>2.0.7-SNAPSHOT</version>
</project>
<!-- docker image name -->
<artifactId>acumos-filebeat</artifactId>
<!-- docker tag -->
- <version>2.0.4-SNAPSHOT</version>
+ <version>2.0.7-SNAPSHOT</version>
</project>
<groupId>org.acumos.platform-oam</groupId>
<artifactId>logging-demo</artifactId>
- <version>0.0.1-SNAPSHOT</version>
+ <version>2.0.7-SNAPSHOT</version>
<packaging>jar</packaging>
<name>logging-demo</name>
<description>Demo project for Logging</description>
import java.util.UUID;
import org.acumos.demo.logging.service.ApplicationService;
+import org.acumos.demo.logging.util.ACUMOSLogConstants;
import org.acumos.demo.logging.util.ACUMOSLogConstants.MDCs;
import org.slf4j.MDC;
import org.springframework.boot.CommandLineRunner;
public void run(String... args) {
String txId = UUID.randomUUID().toString();
-
- MDC.put(MDCs.REQUEST_ID, txId);
- MDC.put(MDCs.RESPONSE_CODE, "500");
- MDC.put(MDCs.RESPONSE_DESCRIPTION, "Internal Server Error");
- MDC.put(MDCs.RESPONSE_SEVERITY, "ERROR");
- MDC.put(MDCs.STATUS_CODE, "ERROR");
+ ACUMOSLogConstants.setDefaultMDCs();
+ MDC.put(MDCs.REQUEST_ID, txId);
MDC.put(MDCs.TARGET_ENTITY, "Onboarding");
MDC.put(MDCs.TARGET_SERVICE_NAME, "Onboarding/api/v2");
MDC.put(MDCs.CLIENT_IP_ADDRESS, "127.0.0.1");
import org.slf4j.Marker;
import org.slf4j.MarkerFactory;
+import org.slf4j.MDC;
+
/**
* Constants for standard ACUMOS headers, MDCs, etc.
/** MDC reporting outcome error level. */
public static final String RESPONSE_SEVERITY = "Severity";
- /** MDC reporting outcome error level. */
+ /** MDC reporting outcome status of the request. */
public static final String STATUS_CODE = "StatusCode";
// Unsorted. ///////////////////////////////////////////////////////////
}
}
+ /**
+ * Overrideable method to set MDCs based on property values.
+ */
+ public static void setDefaultMDCs() {
+ MDC.put(MDCs.RESPONSE_CODE, "200");
+ MDC.put(MDCs.RESPONSE_DESCRIPTION, "200 OK");
+ MDC.put(MDCs.RESPONSE_SEVERITY, ResponseSeverity.INFO.toString());
+ MDC.put(MDCs.STATUS_CODE, ResponseStatus.INPROGRESS.toString());
+ }
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Enums.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
- * Response success or not, for setting <tt>StatusCode</tt>.
+ * Response success or not, for setting StatusCode.
*/
public enum ResponseStatus {
-
- /** Success. */
+
COMPLETED,
-
- /** Not. */
ERROR,
-
- /** In Progress. */
INPROGRESS
}
+ /**
+ * Response of log level, for setting Severity.
+ */
+ public enum ResponseSeverity {
+
+ INFO,
+ ERROR,
+ TRACE,
+ DEBUG,
+ WARN,
+ FATAL
+ }
+
/**
* Synchronous or asynchronous execution, for setting invocation marker.
*/
<!-- docker image name -->
<artifactId>acumos-metricbeat</artifactId>
<!-- docker tag -->
- <version>2.0.4-SNAPSHOT</version>
+ <version>2.0.7-SNAPSHOT</version>
</project>