Class SanitizedLogger
- java.lang.Object
-
- org.identityconnectors.common.logging.SanitizedLogger
-
- All Implemented Interfaces:
LogSpi
public class SanitizedLogger extends java.lang.Object implements LogSpi
SanitizedLogger
implementsLogSpi
. Used to wrap the configuredLogSpi
instance returned inLog.getLog(java.lang.Class<?>, org.identityconnectors.common.logging.LogSpi)
to sanitize control characters in log messages to prevent log injection attacks.
-
-
Constructor Summary
Constructors Constructor Description SanitizedLogger(LogSpi logger)
Implementation ofLogSpi
that sanitizes log messages before delegating to the configured logger.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isLoggable(java.lang.Class<?> clazz, Log.Level level)
Determines if the it should be logged based on Class and Level.void
log(java.lang.Class<?> clazz, java.lang.StackTraceElement caller, Log.Level level, java.lang.String message, java.lang.Throwable ex)
Sanitize control characters from log messages before delegating to the configuredLogSpi
class.void
log(java.lang.Class<?> clazz, java.lang.String method, Log.Level level, java.lang.String message, java.lang.Throwable ex)
Sanitize control characters from log messages before delegating to the configuredLogSpi
class.boolean
needToInferCaller(java.lang.Class<?> clazz, Log.Level level)
Determines ifLog
need to infer caller based on Class and Level.
-
-
-
Method Detail
-
log
public void log(java.lang.Class<?> clazz, java.lang.String method, Log.Level level, java.lang.String message, java.lang.Throwable ex)
Sanitize control characters from log messages before delegating to the configuredLogSpi
class.
-
log
public void log(java.lang.Class<?> clazz, java.lang.StackTraceElement caller, Log.Level level, java.lang.String message, java.lang.Throwable ex)
Sanitize control characters from log messages before delegating to the configuredLogSpi
class.
-
isLoggable
public boolean isLoggable(java.lang.Class<?> clazz, Log.Level level)
Description copied from interface:LogSpi
Determines if the it should be logged based on Class and Level.- Specified by:
isLoggable
in interfaceLogSpi
-
needToInferCaller
public boolean needToInferCaller(java.lang.Class<?> clazz, Log.Level level)
Description copied from interface:LogSpi
Determines ifLog
need to infer caller based on Class and Level.- Specified by:
needToInferCaller
in interfaceLogSpi
-
-