<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:kie="http://drools.org/schema/kie-spring"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                          http://drools.org/schema/kie-spring http://drools.org/schema/kie-spring.xsd">

  <kie:kmodule id="loggers_module">
    <kie:kbase name="drl_kiesample2" packages="drl_kiesample2">

      <kie:ksession name="loggerSession" type="stateless">
        <kie:consoleLogger/>
      </kie:ksession>

      <!-- stateful sessions -->
      <kie:ksession name="ConsoleLogger-statefulSession" type="stateful">
        <kie:consoleLogger/>
        <kie:batch>
          <kie:set-global identifier="persons" ref="globalList"/>
        </kie:batch>
      </kie:ksession>

      <kie:ksession name="FileLogger-statefulSession" type="stateful">
        <kie:fileLogger id="sf_fl_logger" file="#{ systemProperties['java.io.tmpdir'] }/drools-log1"/>
        <kie:batch>
          <kie:set-global identifier="persons" ref="globalList"/>
        </kie:batch>
      </kie:ksession>

      <kie:ksession name="ThreadedFileLogger-statefulSession" type="stateful">
        <kie:fileLogger id="sf_tfl_logger" file="#{ systemProperties['java.io.tmpdir'] }/drools-log2" threaded="true"
                        interval="5"/>
        <kie:batch>
          <kie:set-global identifier="persons" ref="globalList"/>
        </kie:batch>
      </kie:ksession>

      <!-- stateless sessions -->
      <kie:ksession name="ConsoleLogger-statelessSession" type="stateless">
        <kie:consoleLogger/>
      </kie:ksession>

      <kie:ksession name="k2" type="stateless">
        <kie:consoleLogger/>
      </kie:ksession>

      <kie:ksession name="k1" type="stateless">
        <kie:consoleLogger id="k1_console_logger"/>
        <kie:fileLogger id="k1_logger" file="#{ systemProperties['java.io.tmpdir'] }/drools-log3"/>
      </kie:ksession>

      <kie:ksession name="ThreadedFileLogger-statelessSession" type="stateless">
        <kie:fileLogger id="ss_tfl_logger" file="#{ systemProperties['java.io.tmpdir'] }/drools-log4" threaded="true"
                        interval="5"/>
      </kie:ksession>

      <kie:ksession name="FileLogger-statelessSession" type="stateless">
        <kie:fileLogger id="ss_fl_logger" file="#{ systemProperties['java.io.tmpdir'] }/drools-log5"/>
      </kie:ksession>

      <kie:ksession name="FileLogger-statelessSession-noNameLogger" type="stateless">
        <kie:fileLogger file="#{ systemProperties['java.io.tmpdir'] }/drools-log6"/>
      </kie:ksession>

    </kie:kbase>
  </kie:kmodule>


  <bean id="globalList" class="java.util.ArrayList"/>
  <bean id="kiePostProcessor" class="org.kie.spring.KModuleBeanFactoryPostProcessor"/>
</beans>

