<% Logger logger=Logger.getLogger(this.getClass().getName());%>
<c:forEach var="counter" begin="1" end="10" step="1" >
<c:set var="myCount" value="${counter-5}" />
<c:out value="${myCount}"/>
<% String message = "counter="
+ pageContext.findAttribute("counter")
+ " myCount="
+ pageContext.findAttribute("myCount");
logger.info( message );
%>
</c:forEach>