aboutsummaryrefslogtreecommitdiff
path: root/id/server/moa-id-commons/src
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2018-03-12 13:35:46 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2018-03-12 14:16:17 +0100
commitb4c009b6d64cc17974e5917c10f92dbe987d826e (patch)
tree46e3777b7d62ac2d96110d6428d82706d1720345 /id/server/moa-id-commons/src
parenta30826d08c748daaf3d6cdc2329f985852822f54 (diff)
downloadmoa-id-spss-b4c009b6d64cc17974e5917c10f92dbe987d826e.tar.gz
moa-id-spss-b4c009b6d64cc17974e5917c10f92dbe987d826e.tar.bz2
moa-id-spss-b4c009b6d64cc17974e5917c10f92dbe987d826e.zip
add specific AuthBlock validation logging
Diffstat (limited to 'id/server/moa-id-commons/src')
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/logging/Logger.java36
1 files changed, 25 insertions, 11 deletions
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/logging/Logger.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/logging/Logger.java
index 9152f2549..197247630 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/logging/Logger.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/logging/Logger.java
@@ -86,12 +86,16 @@ public class Logger {
* <p>Mainly introduce because the <code>message</code> might be <code>null</code>.
*
* @param message the message
+ * @param escape if this flag is true than the message get escapted before logging
* @return the string
*/
- private static String prepareMessage(Object message) {
+ private static String prepareMessage(Object message, boolean escape) {
if(null == message)
return "no message given";
- return StringEscapeUtils.escapeHtml4(message.toString());
+ if (escape)
+ return StringEscapeUtils.escapeHtml4(message.toString());
+ else
+ return message.toString();
}
/**
@@ -124,7 +128,17 @@ public class Logger {
*/
public static void trace(Object message) {
org.slf4j.Logger logger = getLogger();
- logger.trace(prepareMessage(message));
+ logger.trace(prepareMessage(message, true));
+ }
+
+ /**
+ * Trace a message.
+ *
+ * @param message The message to trace.
+ */
+ public static void traceWithOutEscaption(Object message) {
+ org.slf4j.Logger logger = getLogger();
+ logger.trace(prepareMessage(message, false));
}
/**
@@ -157,7 +171,7 @@ public class Logger {
*/
public static void debug(Object message) {
org.slf4j.Logger logger = getLogger();
- logger.debug(prepareMessage(message));
+ logger.debug(prepareMessage(message, true));
}
/**
@@ -167,7 +181,7 @@ public class Logger {
*/
public static void info(Object message) {
org.slf4j.Logger logger = getLogger();
- logger.info(prepareMessage(message));
+ logger.info(prepareMessage(message, true));
}
/**
@@ -178,7 +192,7 @@ public class Logger {
*/
public static void info(String message, Object[] args) {
org.slf4j.Logger logger = getLogger();
- logger.info(prepareMessage(message), args);
+ logger.info(prepareMessage(message, true), args);
}
/**
@@ -188,7 +202,7 @@ public class Logger {
*/
public static void warn(Object message) {
org.slf4j.Logger logger = getLogger();
- logger.warn(prepareMessage(message));
+ logger.warn(prepareMessage(message, true));
}
/**
@@ -199,7 +213,7 @@ public class Logger {
*/
public static void warn(Object message, Throwable t) {
org.slf4j.Logger logger = getLogger();
- logger.warn(prepareMessage(message), t);
+ logger.warn(prepareMessage(message, true), t);
}
/**
@@ -209,7 +223,7 @@ public class Logger {
*/
public static void error(Object message) {
org.slf4j.Logger logger = getLogger();
- logger.error(prepareMessage(message));
+ logger.error(prepareMessage(message, true));
}
/**
@@ -220,7 +234,7 @@ public class Logger {
*/
public static void error(Object message, Throwable t) {
org.slf4j.Logger logger = getLogger();
- logger.error(prepareMessage(message), t);
+ logger.error(prepareMessage(message, true), t);
}
/**
@@ -231,7 +245,7 @@ public class Logger {
*/
public static void error(Object message, Object[] variables) {
org.slf4j.Logger logger = getLogger();
- logger.error(prepareMessage(message), variables);
+ logger.error(prepareMessage(message, true), variables);
}
/**