title: Spring Batch base step with listeners
body: <p>I would like to setup a base step has a logger listener attached for making sure that all the error logs end up in the correct file. </p>
  
  <p>The setup below i simple enough and rather similar to the example presented on <a href="http://static.springsource.org/spring-batch/reference/html/configureStep.html#mergingListsOnStep" rel="nofollow noreferrer">http://static.springsource.org/spring-batch/reference/html/configureStep.html#mergingListsOnStep</a> but according <a href="http://www.springframework.org/schema/batch/spring-batch.xsd" rel="nofollow noreferrer">http://www.springframework.org/schema/batch/spring-batch.xsd</a>, it seems that listeners don't belong under step but rather under tasklet. </p>
  
  <pre><code>&lt;step id="baseLoggedStep"&gt;
      &lt;listeners&gt;
          &lt;listener&gt;
              &lt;bean class="org.example...StepLogListener"/&gt;
          &lt;/listener&gt;
      &lt;/listeners&gt;
  &lt;/step&gt;
  
  &lt;step id="myJobStep" parent="baseLoggedStep"&gt;
  ... 
  &lt;/step&gt;
  </code></pre>
  
  <p>So, who is correct and how do I use the correct xsd to produce the desired result? </p>
  
  <p>The following base step seems to do the trick, where StepLogListener listener implements StepExecutionListener.</p>
  
  <pre><code>&lt;batch:step id="baseLoggedStep" abstract="true"&gt;
      &lt;batch:tasklet&gt;
          &lt;batch:listeners&gt;
              &lt;batch:listener ref="stepLogListener"&gt;
                  &lt;bean class="com.bossmedia.gem.platform.batch.StepLogListener"/&gt;
              &lt;/batch:listener&gt;
          &lt;/batch:listeners&gt;
      &lt;/batch:tasklet&gt;
  &lt;/batch:step&gt;
  </code></pre>
  
  <p>However it doesn't seem optimal and frankly not entirely correct. This would mean that baseLoggedStep is an abstract instance of TaskletStep right? </p>