protected static void attachLoggers(KieRuntimeEventManager ksession, List<KieLoggerAdaptor> loggerAdaptors) {
if (loggerAdaptors != null && loggerAdaptors.size() > 0) {
KieServices ks = KieServices.Factory.get();
KieLoggers loggers = ks.getLoggers();
for (KieLoggerAdaptor adaptor : loggerAdaptors) {
KieRuntimeLogger runtimeLogger;
switch (KieLoggerAdaptor.KNOWLEDGE_LOGGER_TYPE.valueOf(adaptor.getLoggerType())) {
case LOGGER_TYPE_FILE:
runtimeLogger = loggers.newFileLogger(ksession, adaptor.getFile());
adaptor.setRuntimeLogger(runtimeLogger);
break;