Authored by Gino Zhang

支持动态调整日志级别

... ... @@ -28,7 +28,7 @@ public final class LogUtils {
private static final ScheduledExecutorService POOL = Executors.newScheduledThreadPool(1);
public static synchronized String changeRootLogLevel(String loggerName, String levelStr, int expireSeconds) {
public static synchronized String changeLogLevel(String loggerName, String levelStr, int expireSeconds) {
// 1. 判断参数是否合法 以及是否需要变更日志级别
final Level level = Level.toLevel(levelStr);
if (level == null) {
... ...
... ... @@ -193,7 +193,7 @@ public class ToolsController {
@RequestParam(defaultValue = "DEBUG") String level,
@RequestParam(defaultValue = "60") int seconds) {
try {
return new SearchApiResult().setData(LogUtils.changeRootLogLevel(loggerName, level, seconds));
return new SearchApiResult().setData(LogUtils.changeLogLevel(loggerName, level, seconds));
} catch (Exception e) {
return new SearchApiResult().setCode(500).setMessage(e.getMessage());
}
... ...