public static LoggerContext initialize(final String name, final ClassLoader loader, final List<URI> configLocations, final Object externalContext) { try { final Log4jContextFactory factory = getFactory(); return factory == null ? null : factory.getContext(FQCN, loader, externalContext, false, configLocations, name); } catch (final Exception ex) { LOGGER.error("There was a problem initializing the LoggerContext [{}] using configurations at [{}].", name, configLocations, ex); } return null; }
/** * Initializes the Logging Context. * @param loader The ClassLoader for the Context (or null). * @param source The InputSource for the configuration. * @param externalContext The external context to be attached to the LoggerContext. * @return The LoggerContext. */ public static LoggerContext initialize(final ClassLoader loader, final ConfigurationSource source, final Object externalContext) { try { final Log4jContextFactory factory = getFactory(); return factory == null ? null : factory.getContext(FQCN, loader, externalContext, false, source); } catch (final Exception ex) { LOGGER.error("There was a problem obtaining a LoggerContext using the configuration source [{}]", source, ex); } return null; }
/** * Initializes the Logging Context. * @param name The Context name. * @param loader The ClassLoader for the Context (or null). * @param configLocation The configuration for the logging context (or null). * @param externalContext The external context to be attached to the LoggerContext * @return The LoggerContext. */ public static LoggerContext initialize(final String name, final ClassLoader loader, final URI configLocation, final Object externalContext) { try { final Log4jContextFactory factory = getFactory(); return factory == null ? null : factory.getContext(FQCN, loader, externalContext, false, configLocation, name); } catch (final Exception ex) { LOGGER.error("There was a problem initializing the LoggerContext [{}] using configuration at [{}].", name, configLocation, ex); } return null; }
/** * Initializes the Logging Context. * @param loader The ClassLoader. * @param configuration The Configuration. * @param externalContext - The external context to be attached to the LoggerContext. * @return The LoggerContext. */ public static LoggerContext initialize(final ClassLoader loader, final Configuration configuration, final Object externalContext) { try { final Log4jContextFactory factory = getFactory(); return factory == null ? null : factory.getContext(FQCN, loader, externalContext, false, configuration); } catch (final Exception ex) { LOGGER.error("There was a problem initializing the LoggerContext using configuration {}", configuration.getName(), ex); } return null; }