Package org.forgerock.config.resolvers
Class Logs
- java.lang.Object
-
- org.forgerock.config.resolvers.Logs
-
public final class Logs extends Object
Helper class for logging securely sensitive values.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Consumer<String>
logResolution(Logger logger, PropertyResolver resolver, String key, boolean sensitive)
Securely logs resolved value on the givenlogger
.
-
-
-
Method Detail
-
logResolution
public static Consumer<String> logResolution(Logger logger, PropertyResolver resolver, String key, boolean sensitive)
Securely logs resolved value on the givenlogger
. Ifsensitive
is true, a original value's hashcode is printed, otherwise the real value is printed.Example usage:
value.ifPresent(logResolution(logger, this, key, sensitive));
- Parameters:
logger
- Logger to useresolver
- property resolver that has performed the resolutionkey
- Name of the property.sensitive
- Should the value be masked or not- Returns:
- a function to be used in Optional.ifPresent(Consumer)
- See Also:
System.identityHashCode(Object)
-
-