From 3ec2915b60798b7ff2b99aeec6ccc6aa9fee5d85 Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Thu, 25 Mar 2021 20:08:15 +0100 Subject: update IaikLog implementation to log PII on trace level --- .../at/gv/egovernment/moa/spss/server/logging/IaikLog.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLog.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLog.java index e4a3921..84dc8bf 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLog.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLog.java @@ -108,7 +108,8 @@ public class IaikLog implements iaik.logging.Log { */ @Override public void info(TransactionId transactionId, Object message, Throwable t) { - final IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, maskMessage(message)); + Object blankedMsg = log.isTraceEnabled() ? message : maskMessage(message); + final IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, blankedMsg); log.info(msg.toString(), t); } @@ -126,7 +127,8 @@ public class IaikLog implements iaik.logging.Log { */ @Override public void warn(TransactionId transactionId, Object message, Throwable t) { - final IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, maskMessage(message)); + Object blankedMsg = log.isTraceEnabled() ? message : maskMessage(message); + final IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, blankedMsg); log.warn(msg.toString(), t); } @@ -144,7 +146,8 @@ public class IaikLog implements iaik.logging.Log { */ @Override public void error(TransactionId transactionId, Object message, Throwable t) { - final IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, maskMessage(message)); + Object blankedMsg = log.isTraceEnabled() ? message : maskMessage(message); + final IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, blankedMsg); log.error(msg.toString(), t); } @@ -162,7 +165,8 @@ public class IaikLog implements iaik.logging.Log { */ @Override public void fatal(TransactionId transactionId, Object message, Throwable t) { - final IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, maskMessage(message)); + Object blankedMsg = log.isTraceEnabled() ? message : maskMessage(message); + final IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, blankedMsg); log.error(msg.toString(), t); } -- cgit v1.2.3