Skip to content
This repository was archived by the owner on Apr 23, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.io.FileNotFoundException;
import java.net.URL;

import org.slf4j.impl.StaticLoggerBinder;
import org.springframework.util.ResourceUtils;
import org.springframework.util.SystemPropertyUtils;

Expand Down Expand Up @@ -52,6 +51,8 @@
*/
public class LogbackConfigurer {

private static LoggerContext loggerContext;

private LogbackConfigurer() {
}

Expand All @@ -69,7 +70,9 @@ private LogbackConfigurer() {
public static void initLogging(String location) throws FileNotFoundException, JoranException {
String resolvedLocation = SystemPropertyUtils.resolvePlaceholders(location);
URL url = ResourceUtils.getURL(resolvedLocation);
LoggerContext loggerContext = (LoggerContext)StaticLoggerBinder.getSingleton().getLoggerFactory();

if(loggerContext == null)
loggerContext = new LoggerContext();

// in the current version logback automatically configures at startup the context, so we have to reset it
loggerContext.reset();
Expand Down