Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 056baa21 authored by Joze RIHTARSIC's avatar Joze RIHTARSIC
Browse files

Fix the issue with double logs when defining custom logback properties

parent 93977f8b
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ import eu.europa.ec.edelivery.smp.exceptions.SMPRuntimeException;
import eu.europa.ec.edelivery.smp.logging.SMPLogger;
import eu.europa.ec.edelivery.smp.logging.SMPLoggerFactory;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
......@@ -70,6 +71,7 @@ public class FileProperty {
LOG.info("Set log configuration properties from the file: [{}]", configurationFile.getAbsolutePath());
try (InputStream configStream = new FileInputStream(configurationFile)) {
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
context.reset();
JoranConfigurator configurator = new JoranConfigurator();
configurator.setContext(context);
configurator.doConfigure(configStream); // loads logback file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment