类org.apache.logging.log4j.core.util.ShutdownCallbackRegistry源码实例Demo

下面列出了怎么用org.apache.logging.log4j.core.util.ShutdownCallbackRegistry的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: logging-log4j2   文件: Log4jContextFactory.java
/**
 * Constructs a Log4jContextFactory using the provided ContextSelector and ShutdownRegistrationStrategy.
 *
 * @param selector                     the selector to use
 * @param shutdownCallbackRegistry the ShutdownRegistrationStrategy to use
 * @since 2.1
 */
public Log4jContextFactory(final ContextSelector selector,
                           final ShutdownCallbackRegistry shutdownCallbackRegistry) {
    this.selector = Objects.requireNonNull(selector, "No ContextSelector provided");
    this.shutdownCallbackRegistry = Objects.requireNonNull(shutdownCallbackRegistry, "No ShutdownCallbackRegistry provided");
    LOGGER.debug("Using ShutdownCallbackRegistry {}", shutdownCallbackRegistry.getClass());
    initializeShutdownCallbackRegistry();
}
 
源代码2 项目: logging-log4j2   文件: Log4jContextFactory.java
private static ShutdownCallbackRegistry createShutdownCallbackRegistry() {
    try {
        final ShutdownCallbackRegistry registry = Loader.newCheckedInstanceOfProperty(
            ShutdownCallbackRegistry.SHUTDOWN_CALLBACK_REGISTRY, ShutdownCallbackRegistry.class
        );
        if (registry != null) {
            return registry;
        }
    } catch (final Exception e) {
        LOGGER.error("Unable to create custom ShutdownCallbackRegistry. Falling back to default.", e);
    }
    return new DefaultShutdownCallbackRegistry();
}
 
源代码3 项目: consulo   文件: Log4J2LoggerFactory.java
public Log4J2LoggerFactory() {
  // map message factory to simple, since default message factory is reusable - and will remap our object to string message, without access to object variant
  System.setProperty("log4j2.messageFactory", "org.apache.logging.log4j.message.SimpleMessageFactory");
  System.setProperty(ShutdownCallbackRegistry.SHUTDOWN_HOOK_ENABLED, "false");
  myLoggerContext = init();
}
 
源代码4 项目: logging-log4j2   文件: Log4jContextFactory.java
/**
 * Constructs a Log4jContextFactory using the ContextSelector from {@link Constants#LOG4J_CONTEXT_SELECTOR}
 * and the provided ShutdownRegistrationStrategy.
 *
 * @param shutdownCallbackRegistry the ShutdownRegistrationStrategy to use
 * @since 2.1
 */
public Log4jContextFactory(final ShutdownCallbackRegistry shutdownCallbackRegistry) {
    this(createContextSelector(), shutdownCallbackRegistry);
}
 
源代码5 项目: logging-log4j2   文件: Log4jContextFactory.java
/**
 * Returns the ShutdownCallbackRegistry
 *
 * @return the ShutdownCallbackRegistry
 * @since 2.4
 */
public ShutdownCallbackRegistry getShutdownCallbackRegistry() {
	return shutdownCallbackRegistry;
}
 
 类所在包
 类方法
 同包方法