Add static stopLogback() utility method to the LogbackSupport class.
This commit is contained in:
@@ -75,6 +75,16 @@ public abstract class LogbackSupport {
|
||||
requireLoggerContext().putObject(SPRING_BOOT_LOGGING_SYSTEM_CLASS_NAME, new Object());
|
||||
}
|
||||
|
||||
/**
|
||||
* Properly stops Logback classic.
|
||||
*
|
||||
* @see <a href="https://logback.qos.ch/manual/configuration.html#stopContext">Stopping logback-classic</a>
|
||||
*/
|
||||
public static void stopLogback() {
|
||||
resolveLoggerContext()
|
||||
.ifPresent(LoggerContext::stop);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the state of the SLF4J Logback logging provider and system.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user