public static void setupLogging(boolean console)
  {
    LoggerContext loggerContext = (LoggerContext) LoggerFactory.
      getILoggerFactory();

    JoranConfigurator jc = new JoranConfigurator();
    jc.setContext(loggerContext);
    loggerContext.reset();
    try
    {
      jc.doConfigure(System.getProperty("annis.home")
        + "/conf/logback.xml");
    }
    catch (JoranException ex)
    {
      System.out.println(ex.getMessage());
    }

    ConsoleAppender<ILoggingEvent> consoleAppender = new ConsoleAppender<>();
    consoleAppender.setContext(loggerContext);
    consoleAppender.setName("CONSOLE");

    consoleAppender.setLayout(new ConsoleLayout());

    ThresholdFilter consoleFilter = new ConsoleFilter();

    consoleFilter.setLevel(console ? "DEBUG" : "WARN");
    consoleFilter.start();

    consoleAppender.addFilter(consoleFilter);
    consoleAppender.setTarget("System.err");
    consoleAppender.start();

    ch.qos.logback.classic.Logger logbackLogger = loggerContext.getLogger(
      Logger.ROOT_LOGGER_NAME);

    logbackLogger.addAppender(consoleAppender);

    SLF4JBridgeHandler.removeHandlersForRootLogger();;
    SLF4JBridgeHandler.install();
  }
public static void setupLogging ( boolean console ) { LoggerContext loggerContext = ( LoggerContext ) LoggerFactory . getILoggerFactory ( ) ; JoranConfigurator jc = new JoranConfigurator ( ) ; jc . setContext ( loggerContext ) ; loggerContext . reset ( ) ; try { jc . doConfigure ( System . getProperty ( "annis.home" ) + "/conf/logback.xml" ) ; } catch ( JoranException ex ) { System . out . println ( ex . getMessage ( ) ) ; } ConsoleAppender < ILoggingEvent > consoleAppender = new ConsoleAppender < > ( ) ; consoleAppender . setContext ( loggerContext ) ; consoleAppender . setName ( "CONSOLE" ) ; consoleAppender . setLayout ( new ConsoleLayout ( ) ) ; ThresholdFilter consoleFilter = new ConsoleFilter ( ) ; consoleFilter . setLevel ( console ? "DEBUG" : "WARN" ) ; consoleFilter . start ( ) ; consoleAppender . addFilter ( consoleFilter ) ; consoleAppender . setTarget ( "System.err" ) ; consoleAppender . start ( ) ; ch . qos . logback . classic . Logger logbackLogger = loggerContext . getLogger ( Logger . ROOT_LOGGER_NAME ) ; logbackLogger . addAppender ( consoleAppender ) ; SLF4JBridgeHandler . removeHandlersForRootLogger ( ) ; ; SLF4JBridgeHandler . install ( ) ; }
configure logging