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
ConstructorsConstructorDescriptionSanitizedLogger(LogSpi logger) Implementation ofLogSpithat sanitizes log messages before delegating to the configured logger. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisLoggable(Class<?> clazz, Log.Level level) Determines if the it should be logged based on Class and Level.voidSanitize control characters from log messages before delegating to the configuredLogSpiclass.voidSanitize control characters from log messages before delegating to the configuredLogSpiclass.booleanneedToInferCaller(Class<?> clazz, Log.Level level) Determines ifLogneed to infer caller based on Class and Level.
-
Constructor Details
-
SanitizedLogger
Implementation ofLogSpithat sanitizes log messages before delegating to the configured logger.
-
-
Method Details
-
log
Sanitize control characters from log messages before delegating to the configuredLogSpiclass. -
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 configuredLogSpiclass. -
isLoggable
Description copied from interface:LogSpiDetermines if the it should be logged based on Class and Level.- Specified by:
isLoggablein interfaceLogSpi
-
needToInferCaller
Description copied from interface:LogSpiDetermines ifLogneed to infer caller based on Class and Level.- Specified by:
needToInferCallerin interfaceLogSpi
-