in src/main/java/software/aws/chatops_lex_api/resource/LoggingConfigurator.java [17:33]
public static final void configure() {
LoggerContext context = (org.apache.logging.log4j.core.LoggerContext) LogManager.getContext(false);
try {
context.setConfigLocation( Thread.currentThread().getContextClassLoader().getResource("software/aws/chatops_lex_api/resource/log4j2.xml").toURI() );
} catch (URISyntaxException e) {
System.out.println("Cannot start logging framework: Log4j2. Configuration File Not Found. URISyntaxException:"+e.getMessage());
e.printStackTrace();
}
context.reconfigure();
context.start();
context.updateLoggers();
System.setErr( IoBuilder.forLogger( LogManager.getRootLogger()).setLevel(Level.ERROR).buildPrintStream() );
System.setOut( IoBuilder.forLogger( LogManager.getRootLogger()).setLevel(Level.INFO).buildPrintStream() );
System.out.println("Just configured log4j2 and redirected System.out and System.err messages to RootLogger.");
logger.info("Log4j2 is set.");
}