<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@page import="org.apache.log4j.Logger"%>
<%@page import="org.apache.log4j.Level"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="/spring" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>log4j settings</title>
</head>
<body>
<script>
function setLevel(logger, level) {
	document.location = 'log_settings.html?logger=' + logger + '&level=' + level;
}
</script>
	
<div class="fsection" style="text-align:center;"><BR>Log settings</div><BR><BR style="line-height:80%;">
	<table class="formtable" align="center" cellpadding=5 cellspacing=0 border="0" width="90%">
		<tbody>
			<c:forEach var="logger" items="${loggers}" varStatus="n">
				<tr class="${n.index % 2 == 0 ? 'tableevenrow' : 'tableoddrow'}">
					<td align=left>${loggerDesc[logger.key]}</td>
					<td align=left>${logger.key}</td>
					<td align=left>
						<select onchange="setLevel('${logger.key}', this.options[this.selectedIndex].value)">
							<c:forEach var="level" items="ERROR,WARN,INFO,DEBUG">
								<option value="${level}"
									<c:if test="${logger.value == level}">selected</c:if> 
									>${level}</option>
							</c:forEach>
						</select>
					</td>
				</tr>
			</c:forEach>
			<tr class="${fn:length(loggers) % 2 == 0 ? 'tableevenrow' : 'tableoddrow'}">
				<td/>
				<td align=left><input type="text" size="80" value="" id="newLoggerName" class="fnormal"/></td>
				<td align=left>
					<select onchange="setLevel(getElementById('newLoggerName').value, this.options[this.selectedIndex].value)">
						<c:forEach var="level" items="ERROR,WARN,INFO,DEBUG">
							<option value="${level}">${level}</option>
						</c:forEach>
					</select>
				</td>
			</tr>
		</tbody>
	</table>

</body>
</html>