Commit 2835085f authored by Phillip Webb's avatar Phillip Webb

Polish

parent 28abcf88
/* /*
* Copyright 2012-2020 the original author or authors. * Copyright 2012-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -164,7 +164,7 @@ public class JavaLoggingSystem extends AbstractLoggingSystem { ...@@ -164,7 +164,7 @@ public class JavaLoggingSystem extends AbstractLoggingSystem {
@Override @Override
public Runnable getShutdownHandler() { public Runnable getShutdownHandler() {
return new ShutdownHandler(); return () -> LogManager.getLogManager().reset();
} }
@Override @Override
...@@ -172,15 +172,6 @@ public class JavaLoggingSystem extends AbstractLoggingSystem { ...@@ -172,15 +172,6 @@ public class JavaLoggingSystem extends AbstractLoggingSystem {
this.configuredLoggers.clear(); this.configuredLoggers.clear();
} }
private static final class ShutdownHandler implements Runnable {
@Override
public void run() {
LogManager.getLogManager().reset();
}
}
/** /**
* {@link LoggingSystemFactory} that returns {@link JavaLoggingSystem} if possible. * {@link LoggingSystemFactory} that returns {@link JavaLoggingSystem} if possible.
*/ */
......
...@@ -301,7 +301,7 @@ public class Log4J2LoggingSystem extends Slf4JLoggingSystem { ...@@ -301,7 +301,7 @@ public class Log4J2LoggingSystem extends Slf4JLoggingSystem {
@Override @Override
public Runnable getShutdownHandler() { public Runnable getShutdownHandler() {
return new ShutdownHandler(); return () -> getLoggerContext().stop();
} }
@Override @Override
...@@ -341,15 +341,6 @@ public class Log4J2LoggingSystem extends Slf4JLoggingSystem { ...@@ -341,15 +341,6 @@ public class Log4J2LoggingSystem extends Slf4JLoggingSystem {
loggerContext.setExternalContext(null); loggerContext.setExternalContext(null);
} }
private final class ShutdownHandler implements Runnable {
@Override
public void run() {
getLoggerContext().stop();
}
}
/** /**
* {@link LoggingSystemFactory} that returns {@link Log4J2LoggingSystem} if possible. * {@link LoggingSystemFactory} that returns {@link Log4J2LoggingSystem} if possible.
*/ */
......
...@@ -281,7 +281,7 @@ public class LogbackLoggingSystem extends Slf4JLoggingSystem { ...@@ -281,7 +281,7 @@ public class LogbackLoggingSystem extends Slf4JLoggingSystem {
@Override @Override
public Runnable getShutdownHandler() { public Runnable getShutdownHandler() {
return new ShutdownHandler(); return () -> getLoggerContext().stop();
} }
private ch.qos.logback.classic.Logger getLogger(String name) { private ch.qos.logback.classic.Logger getLogger(String name) {
...@@ -328,15 +328,6 @@ public class LogbackLoggingSystem extends Slf4JLoggingSystem { ...@@ -328,15 +328,6 @@ public class LogbackLoggingSystem extends Slf4JLoggingSystem {
loggerContext.removeObject(LoggingSystem.class.getName()); loggerContext.removeObject(LoggingSystem.class.getName());
} }
private final class ShutdownHandler implements Runnable {
@Override
public void run() {
getLoggerContext().stop();
}
}
/** /**
* {@link LoggingSystemFactory} that returns {@link LogbackLoggingSystem} if possible. * {@link LoggingSystemFactory} that returns {@link LogbackLoggingSystem} if possible.
*/ */
......
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