@Override public void setAdditivity(boolean additivity) { logger.setAdditive(additivity); }
public Slf4jLog4j2AdapterActivateOption(Object logger) { super(null); try { org.apache.logging.log4j.core.Logger log4j2Logger = (org.apache.logging.log4j.core.Logger)loggerField.get( logger); super.logger = log4j2Logger; super.configuration = super.logger.getContext().getConfiguration(); } catch (Exception e) { throw new RuntimeException("logger must be instanceof org.apache.logging.slf4j.Log4jLogger", e); } }
/** * Gets the root logger. * * @return the root logger. */ public Logger getRootLogger() { return loggerContext.getRootLogger(); }
/** * Gets the associated Configuration for the configuration file this was constructed with. * * @return this LoggerContext's Configuration. */ public Configuration getConfiguration() { return loggerContext.getConfiguration(); }
protected void initRootLogger(final Appender appender) { root.addAppender(appender); root.setAdditive(false); root.setLevel(Level.DEBUG); }
@AfterClass public static void tearDownStatic() { final Logger logger = (Logger) LogManager.getLogger( LoggingRequestLogger.class); logger.removeAppender(appender); appender.stop(); }
/** * Gets a named Logger in this LoggerContext. * * @param name * the name of the Logger to look up or create. * @return the named Logger. */ public Logger getLogger(final String name) { return loggerContext.getLogger(name); }
@Override public boolean isStopped() { return State.STOPPED.equals(getState()); }
private static DeleteAction create(final String path, final boolean followLinks, final int maxDepth, final boolean testMode, final PathCondition[] conditions) { final Configuration config = new BasicConfigurationFactory().new BasicConfiguration(); final DeleteAction delete = DeleteAction.createDeleteAction(path, followLinks, maxDepth, testMode, null, conditions, null, config); return delete; }
public static void stopLoggerContext(final boolean currentContext, final File checkFilePresence) throws InterruptedException { stopLoggerContext(currentContext); sleepAndCheck(checkFilePresence); }
@Override public void shutdown() { CoreLoggerContexts.stopLoggerContext(); // stop async thread }
public void setCompletionStatus(final String msg) { setMessageFormat(msg); } }
@Override public Configuration getConfiguration(final LoggerContext loggerContext, final String name, final URI configLocation) { return new BasicConfiguration(); }
public static TestFormatPatternConverter newInstance(final String[] options) { return new TestFormatPatternConverter(); }
/** * Gets a named Logger using the test class's name from this LoggerContext. * * @return the test class's named Logger. */ public Logger getLogger() { return loggerContext.getLogger(testClassName); }
@Override public boolean isStarted() { return State.STARTED.equals(getState()); }
public static void stopLoggerContext(final File checkFilePresence) throws InterruptedException { stopLoggerContext(); sleepAndCheck(checkFilePresence); }
public SyslogAppenderTest() { root = ctx.getLogger("SyslogAppenderTest"); }