aboutsummaryrefslogtreecommitdiffstats
path: root/common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/Markers.java
diff options
context:
space:
mode:
Diffstat (limited to 'common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/Markers.java')
-rw-r--r--common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/Markers.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/Markers.java b/common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/Markers.java
new file mode 100644
index 0000000000..dc2ae367b3
--- /dev/null
+++ b/common/openecomp-logging-lib/openecomp-logging-core/src/main/java/org/openecomp/core/logging/Markers.java
@@ -0,0 +1,21 @@
+package org.openecomp.core.logging;
+
+import org.slf4j.Marker;
+import org.slf4j.MarkerFactory;
+
+/**
+ * <p>The list of markers that can be used for special logging such as metrics, audit, etc.</p>
+ * <p>Although markers can be easily instantiated whenever needed, having constants for them helps
+ * eliminate mistakes - misspelling, using a marker that is not handled, etc.</p> <p>Usage:</p>
+ * <pre>
+ * Logger log = LogFactory.getLogger(this.getClass());
+ * log.info(Markers.AUDIT, "User '{}' logged out", user);
+ * </pre>
+ *
+ * @see org.slf4j.Marker
+ */
+public class Markers {
+
+ public static final Marker AUDIT = MarkerFactory.getMarker("AUDIT");
+ public static final Marker METRICS = MarkerFactory.getMarker("METRICS");
+}