Commit 31af4688 authored by Matija Obreza's avatar Matija Obreza

Use provided log level when registering a new logger

parent 0480d03e
......@@ -112,9 +112,9 @@ public class LoggerController {
}
@RequestMapping(method = RequestMethod.POST, value = "/addLoger")
public String addLogger(@RequestParam(value = "nameNewLogger") String nameNewLogger, Model model) {
public String addLogger(@RequestParam(value = "nameNewLogger") String nameNewLogger, @RequestParam("loggerLevel") String loggerLevel, Model model) {
Logger logger = Logger.getLogger(nameNewLogger);
logger.setLevel(Level.INFO);
logger.setLevel(Level.toLevel(loggerLevel));
return "redirect:/admin/logger/";
}
......
......@@ -36,7 +36,7 @@
</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">
<c:forTokens items="trace,debug,info,warn,error,fatal,off" delims="," var="level">
<option value="${level}" ${level=="debug" ? "selected" : "" }>
<c:out value="${level}"/>
</option>
......
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