001package ch.qos.logback.classic.issue.logback_1162; 002import org.slf4j.Logger; 003import org.slf4j.LoggerFactory; 004 005import ch.qos.logback.classic.ClassicTestConstants; 006import ch.qos.logback.classic.LoggerContext; 007import ch.qos.logback.classic.joran.JoranConfigurator; 008import ch.qos.logback.core.joran.spi.JoranException; 009 010import java.util.concurrent.TimeUnit; 011 012public class Main { 013 private static final Logger logger = LoggerFactory.getLogger(Main.class); 014 015 public static void main(String[] args) throws InterruptedException, JoranException { 016 LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); 017 lc.reset(); 018 lc.putProperty("output_dir", ClassicTestConstants.OUTPUT_DIR_PREFIX+"logback_issue_1162/"); 019 020 JoranConfigurator configurator = new JoranConfigurator(); 021 configurator.setContext(lc); 022 configurator.doConfigure(ClassicTestConstants.JORAN_INPUT_PREFIX+ "issues/logback_1162.xml"); 023 024 025 logger.info("Hello, world!"); 026 027 TimeUnit.SECONDS.sleep(0); 028 } 029}