summaryrefslogtreecommitdiff
path: root/eaaf_core_utils/src/main
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2020-03-04 14:11:41 +0100
committerThomas Lenz <thomas.lenz@egiz.gv.at>2020-03-04 14:11:41 +0100
commit0ee672f95f27b26eddc127e6d358e1e6d462b020 (patch)
treee233127076d863d26dbdffa1b6c256bb772b006c /eaaf_core_utils/src/main
parentdf31d6f5ec7aeabdccdf6a23eb946e9ce014832b (diff)
downloadEAAF-Components-0ee672f95f27b26eddc127e6d358e1e6d462b020.tar.gz
EAAF-Components-0ee672f95f27b26eddc127e6d358e1e6d462b020.tar.bz2
EAAF-Components-0ee672f95f27b26eddc127e6d358e1e6d462b020.zip
add "remoteHost" information into TransactionIdUtils
rename MDC variables for Logging
Diffstat (limited to 'eaaf_core_utils/src/main')
-rw-r--r--eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/TransactionIdUtils.java31
1 files changed, 27 insertions, 4 deletions
diff --git a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/TransactionIdUtils.java b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/TransactionIdUtils.java
index 4cbcfa70..5a26eea3 100644
--- a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/TransactionIdUtils.java
+++ b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/TransactionIdUtils.java
@@ -29,21 +29,25 @@ import at.gv.egiz.eaaf.core.api.IRequest;
*/
public class TransactionIdUtils {
- // MDC variables for logging
/**
* To correlate technical logs over one single transactions.
*/
- public static final String MDC_TRANSACTION_ID = "transactionId";
+ public static final String MDC_TRANSACTION_ID = "transactionid";
/**
* To correlate technical logs over a set of transactions, like SSO.
*/
- public static final String MDC_SESSION_ID = "sessionId";
+ public static final String MDC_SESSION_ID = "sessionid";
/**
* Unique application identifier that is processed in this transaction.
*/
- public static final String MDC_SERVICEPROVIDER_ID = "oaId";
+ public static final String MDC_SERVICEPROVIDER_ID = "oaid";
+
+ /**
+ * Unique application identifier that is processed in this transaction.
+ */
+ public static final String MDC_REMOTEHOST = "remoteHost";
/**
* Set all MDC variables from pending request to this threat context.<br>
@@ -67,6 +71,7 @@ public class TransactionIdUtils {
removeSessionId();
removeTransactionId();
removeServiceProviderId();
+ removeRemoteHost();
}
@@ -135,5 +140,23 @@ public class TransactionIdUtils {
}
+ /**
+ * Set remoteHost information to correlate technical logs.
+ *
+ * @param remoteHost IP address of the remote host
+ */
+ public static void setRemoteHost(final String remoteHost) {
+ org.slf4j.MDC.put(MDC_REMOTEHOST, remoteHost);
+
+ }
+
+ /**
+ * Remove remoteHost for Logging.
+ */
+ public static void removeRemoteHost() {
+ org.slf4j.MDC.remove(MDC_REMOTEHOST);
+
+ }
+
}