Commit 7e73e749 authored by Maxym Borodenko's avatar Maxym Borodenko Committed by Matija Obreza

Loggers admin failure

Signed-off-by: Matija Obreza's avatarMatija Obreza <matija.obreza@croptrust.org>
parent 7b732410
Pipeline #2464 waiting for manual action with stages
in 3 minutes and 39 seconds
......@@ -6,8 +6,6 @@ import java.util.Comparator;
import java.util.Enumeration;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
......@@ -27,7 +25,7 @@ import org.springframework.web.bind.annotation.RequestParam;
@PreAuthorize("hasRole('ADMINISTRATOR')")
public class LoggerController {
public static final Log LOG = LogFactory.getLog(AdminController.class);
private static final Logger LOG = Logger.getLogger(AdminController.class);
@Value("${paginator.default.pageSize}")
int defaultPageSize;
......@@ -79,7 +77,7 @@ public class LoggerController {
logger.setLevel(loggerLevel == null ? null : Level.toLevel(loggerLevel));
}
return "redirect:/admin/logger/" + loggerName + ".";
return "redirect:/admin/logger/";
}
private List<Logger> getAllLoggers() {
......
......@@ -6,26 +6,24 @@
<html>
<head>
<title><spring:message code="loggers.list.page" /></title>
<title><spring:message code="loggers.list.page"/></title>
</head>
<body>
<table class="table table-striped">
<thead>
<tr>
<th class="col-xs-8"><spring:message code="logger.name" /></th>
<th class="col-xs-4 text-right"><spring:message
code="logger.log-level" /></th>
<th class="col-xs-8"><spring:message code="logger.name"/></th>
<th class="col-xs-4 text-right"><spring:message code="logger.log-level"/></th>
</tr>
</thead>
<tbody>
<c:forEach items="${loggers.content}" var="logger" varStatus="status">
<tr>
<td class="col-xs-8 form-control-static"><a
href="<c:url value="/admin/logger/${logger.name}." />"><c:out value="${logger.name}" /></a>
<td class="col-xs-8 form-control-static">
<a href="<c:url value="/admin/logger/${logger.name}" />"><c:out value="${logger.name}"/></a>
</td>
<td class="col-xs-4 text-right form-control-static"><c:out
value="${logger.level}" /></td>
<td class="col-xs-4 text-right form-control-static"><c:out value="${logger.level}"/></td>
</tr>
</c:forEach>
</tbody>
......@@ -34,38 +32,34 @@
<div class="row">
<form method="post" action=<c:url value="/admin/logger/addLoger"/>>
<div class="form-group col-xs-8">
<input class="form-control" type="text" name="nameNewLogger"
placeholder="com.example.package.Class" />
<input class="form-control" type="text" name="nameNewLogger" placeholder="com.example.package.Class"/>
</div>
<div class="form-group col-xs-4">
<select class="form-control" name="loggerLevel">
<c:forTokens items="all,debug,info,warn,error,fatal,off,trace"
delims="," var="level">
<option value="${level}" ${level == "debug" ? "selected" : ""}>
<c:out value="${level}" /></option>
<c:forTokens items="all,debug,info,warn,error,fatal,off,trace" delims="," var="level">
<option value="${level}" ${level=="debug" ? "selected" : "" }>
<c:out value="${level}"/>
</option>
</c:forTokens>
</select>
</div>
<div class="form-group col-xs-2">
<input type="submit" class="btn btn-primary"
value="<spring:message code="logger.add-logger" />" />
<input type="submit" class="btn btn-primary" value="<spring:message code="logger.add-logger" />"/>
</div>
<!-- CSRF protection -->
<input type="hidden" name="${_csrf.parameterName}"
value="${_csrf.token}" />
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
</form>
</div>
<local:paginate2 page="${loggers}" />
<local:paginate2 page="${loggers}"/>
<content tag="javascript">
<script type="text/javascript">
$(document).ready(function() {
$('#logger-menu-item').addClass('active');
$('#logger-menu-item').find("a").first().addClass('active');
});
$(document).ready(function () {
$('#logger-menu-item').addClass('active');
$('#logger-menu-item').find("a").first().addClass('active');
});
</script>
</content>
</body>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment