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