use of org.identityconnectors.common.logging.impl.JDKLogger in project CzechIdMng by bcvsolutions.
the class IcInitDataProcessor method process.
@Override
public EventResult<ModuleDescriptorDto> process(EntityEvent<ModuleDescriptorDto> event) {
LOG.info("Initialization [{}] module...", IcModuleDescriptor.MODULE_ID);
// ConnId using logger implementation, what cannot be configured (printing
// always). We need change the implementation to JDKLogger.
// Second way how configuring that property, is create property file
// 'connectors.properties' in the java home (jre/lib), witch will contains same
// property.
System.setProperty(PROPERTY_CONNID_LOGGER_IMPLEMENTATION, JDKLogger.class.getName());
// VŠ: I had to use this hard code. Because logger in Connid is cached and calls before this initialisation.
try {
Method spiClassMethod = Arrays.asList(Log.class.getDeclaredMethods()).stream().filter(propertyDescriptor -> {
return PROPERTY_SET_LOGGER.equals(propertyDescriptor.getName());
}).findFirst().orElse(null);
spiClassMethod.setAccessible(true);
spiClassMethod.invoke(Log.class, new Object[] { null });
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
throw new CoreException(e);
}
//
return new DefaultEventResult<>(event, this);
}
Aggregations