use of org.apache.logging.log4j.core.LoggerContext in project pyramid by cheng-li.
the class IMLLogisticRegressionTest method main.
public static void main(String[] args) throws Exception {
LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
Configuration config = ctx.getConfiguration();
LoggerConfig loggerConfig = config.getLoggerConfig(LogManager.ROOT_LOGGER_NAME);
loggerConfig.setLevel(Level.DEBUG);
ctx.updateLoggers();
test1();
}
use of org.apache.logging.log4j.core.LoggerContext in project pyramid by cheng-li.
the class LogisticRegressionTest method main.
public static void main(String[] args) throws Exception {
LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
Configuration config = ctx.getConfiguration();
LoggerConfig loggerConfig = config.getLoggerConfig(LogManager.ROOT_LOGGER_NAME);
loggerConfig.setLevel(Level.DEBUG);
ctx.updateLoggers();
// test3();
test5();
}
use of org.apache.logging.log4j.core.LoggerContext in project pyramid by cheng-li.
the class RegressionSynthesizerTest method main.
public static void main(String[] args) throws Exception {
LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
Configuration config = ctx.getConfiguration();
LoggerConfig loggerConfig = config.getLoggerConfig(LogManager.ROOT_LOGGER_NAME);
loggerConfig.setLevel(Level.DEBUG);
ctx.updateLoggers();
// test1();
}
use of org.apache.logging.log4j.core.LoggerContext in project gatk by broadinstitute.
the class LoggingUtils method setLog4JLoggingLevel.
private static void setLog4JLoggingLevel(Log.LogLevel verbosity) {
// Now establish the logging level used by log4j by propagating the requested
// logging level to all loggers associated with our logging configuration.
final LoggerContext loggerContext = (LoggerContext) LogManager.getContext(false);
final Configuration loggerContextConfig = loggerContext.getConfiguration();
final String contextClassName = LoggingUtils.class.getName();
final LoggerConfig loggerConfig = loggerContextConfig.getLoggerConfig(contextClassName);
loggerConfig.setLevel(levelToLog4jLevel(verbosity));
loggerContext.updateLoggers();
}
use of org.apache.logging.log4j.core.LoggerContext in project oxTrust by GluuFederation.
the class AppInitializer method updateLoggingSeverity.
public void updateLoggingSeverity(@Observes @ConfigurationUpdate AppConfiguration appConfiguration) {
String loggingLevel = appConfiguration.getLoggingLevel();
if (StringHelper.isEmpty(loggingLevel)) {
return;
}
log.info("Setting loggers level to: '{}'", loggingLevel);
LoggerContext loggerContext = LoggerContext.getContext(false);
if (StringHelper.equalsIgnoreCase("DEFAULT", loggingLevel)) {
log.info("Reloadming log4j configuration");
loggerContext.reconfigure();
return;
}
Level level = Level.toLevel(loggingLevel, Level.INFO);
for (org.apache.logging.log4j.core.Logger logger : loggerContext.getLoggers()) {
String loggerName = logger.getName();
if (loggerName.startsWith("org.xdi.service") || loggerName.startsWith("org.xdi.oxauth") || loggerName.startsWith("org.gluu")) {
logger.setLevel(level);
}
}
}
Aggregations