use of org.apache.logging.log4j.core.config.LoggerConfig 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.config.LoggerConfig in project storm by apache.
the class LogConfigManager method getLoggerLevels.
public Map<String, Level> getLoggerLevels() {
Configuration loggerConfig = ((LoggerContext) LogManager.getContext(false)).getConfiguration();
Map<String, Level> logLevelMap = new HashMap<>();
for (Map.Entry<String, LoggerConfig> entry : loggerConfig.getLoggers().entrySet()) {
logLevelMap.put(entry.getKey(), entry.getValue().getLevel());
}
return logLevelMap;
}
use of org.apache.logging.log4j.core.config.LoggerConfig in project hive by apache.
the class OperationManager method initOperationLogCapture.
private void initOperationLogCapture(String loggingMode) {
// Register another Appender (with the same layout) that talks to us.
Appender ap = LogDivertAppender.createInstance(this, OperationLog.getLoggingLevel(loggingMode));
LoggerContext context = (LoggerContext) LogManager.getContext(false);
Configuration configuration = context.getConfiguration();
LoggerConfig loggerConfig = configuration.getLoggerConfig(LoggerFactory.getLogger(getClass()).getName());
loggerConfig.addAppender(ap, null, null);
context.updateLoggers();
ap.start();
}
use of org.apache.logging.log4j.core.config.LoggerConfig in project hive by apache.
the class HiveEventCounter method removeFromLogger.
@VisibleForTesting
public void removeFromLogger(String loggerName) {
LoggerConfig loggerConfig = configuration.getLoggerConfig(loggerName);
loggerConfig.removeAppender(APPENDER_NAME);
context.updateLoggers();
}
use of org.apache.logging.log4j.core.config.LoggerConfig in project hive by apache.
the class NullAppender method addToLogger.
public void addToLogger(String loggerName, Level level) {
LoggerConfig loggerConfig = configuration.getLoggerConfig(loggerName);
loggerConfig.addAppender(this, level, null);
context.updateLoggers();
}
Aggregations