org.geotools.util.logging.Logging.setLoggerFactory()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中org.geotools.util.logging.Logging.setLoggerFactory()方法的一些代码示例,展示了Logging.setLoggerFactory()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logging.setLoggerFactory()方法的具体详情如下:
包路径:org.geotools.util.logging.Logging
类名称:Logging
方法名:setLoggerFactory

Logging.setLoggerFactory介绍

[英]Sets a new logger factory from a fully qualidifed class name. This method should be preferred to #setLoggerFactory(LoggerFactory) when the underlying logging framework is not garanteed to be on the classpath.
[中]从完全限定的类名设置新的记录器工厂。当底层日志框架不保证在类路径上时,应该首选此方法而不是#setLoggerFactory(LoggerFactory)。

代码示例

代码示例来源:origin: geoserver/geoserver

try {
  if (logging == GeoToolsLoggingRedirection.CommonsLogging) {
    Logging.ALL.setLoggerFactory(CommonsLoggerFactory.getInstance());
  } else if (logging != GeoToolsLoggingRedirection.JavaLogging) {
    Logging.ALL.setLoggerFactory(Log4JLoggerFactory.getInstance());

代码示例来源:origin: geotools/geotools

/**
 * Sets the global {@linkplain LoggerFactory logger factory}.
 *
 * <p>This method is the same as {@code Logging.GEOTOOLS.setLoggerFactory(factory)}. GeoTools
 * ships with support for <A
 * HREF="http://jakarta.apache.org/commons/logging/">Commons-logging</A> and <A
 * HREF="http://logging.apache.org/log4j/">log4j</A>. This method exists to allow you supply
 * your own implementation (this is sometimes required when using a GeoTools application in an
 * exotic environment like Eclipse, OC4J or your application).
 *
 * @param factory The logger factory to use.
 * @see Logging#setLoggerFactory(LoggerFactory)
 * @since 2.4
 */
public void setLoggerFactory(final LoggerFactory<?> factory) {
  Logging.GEOTOOLS.setLoggerFactory(factory);
}

代码示例来源:origin: geoserver/geoserver

Logging.ALL.setLoggerFactory(Log4JLoggerFactory.getInstance());
} catch (Exception e) {
  LOGGER.log(Level.SEVERE, "Could not configure log4j logging redirection", e);

代码示例来源:origin: geotools/geotools

/**
 * Sets a new logger factory for this {@code Logging} instance and every children. The specified
 * factory will be used by <code>{@linkplain #getLogger(String) getLogger}(name)</code> when
 * {@code name} is this {@code Logging} name or one of its children.
 */
public void setLoggerFactory(final LoggerFactory<?> factory) {
  synchronized (EMPTY) {
    this.factory = factory;
    for (int i = 0; i < children.length; i++) {
      children[i].setLoggerFactory(factory);
    }
    sameLoggerFactory = sameLoggerFactory(ALL.children, ALL.factory);
  }
}

代码示例来源:origin: geoserver/geoserver

Logging.ALL.setLoggerFactory(Log4JLoggerFactory.getInstance());
} catch (Exception e) {
  LOGGER.log(Level.SEVERE, "Could not configure log4j logging redirection", e);

代码示例来源:origin: geotools/geotools

final Logging log = Logging.GEOTOOLS;
try {
  log.setLoggerFactory("org.geotools.util.logging.CommonsLoggerFactory");
} catch (ClassNotFoundException commonsException) {
  try {
    log.setLoggerFactory("org.geotools.util.logging.Log4JLoggerFactory");
  } catch (ClassNotFoundException log4jException) {

代码示例来源:origin: geotools/geotools

setLoggerFactory(factory);

代码示例来源:origin: org.geotools/gt2-metadata

/**
 * Sets the global {@linkplain LoggerFactory logger factory}.
 * 
 * This method is the same as {@code Logging.GEOTOOLS.setLoggerFactory(factory)}.
 * GeoTools ships with support for
 * <A HREF="http://jakarta.apache.org/commons/logging/">Commons-logging</A> and
 * <A HREF="http://logging.apache.org/log4j/">log4j</A>. This method exists to allow you
 * supply your own implementation (this is sometimes required when using a GeoTools
 * application in an exotic environment like Eclipse, OC4J or your application).
 *
 * @see Logging#setLoggerFactory(LoggerFactory)
 *
 * @since 2.4
 */
public void setLoggerFactory(final LoggerFactory factory) {
  Logging.GEOTOOLS.setLoggerFactory(factory);
}

代码示例来源:origin: org.geotools/gt-metadata

/**
 * Sets the global {@linkplain LoggerFactory logger factory}.
 *
 * This method is the same as {@code Logging.GEOTOOLS.setLoggerFactory(factory)}.
 * GeoTools ships with support for
 * <A HREF="http://jakarta.apache.org/commons/logging/">Commons-logging</A> and
 * <A HREF="http://logging.apache.org/log4j/">log4j</A>. This method exists to allow you
 * supply your own implementation (this is sometimes required when using a GeoTools
 * application in an exotic environment like Eclipse, OC4J or your application).
 *
 * @param factory The logger factory to use.
 *
 * @see Logging#setLoggerFactory(LoggerFactory)
 *
 * @since 2.4
 */
public void setLoggerFactory(final LoggerFactory factory) {
  Logging.GEOTOOLS.setLoggerFactory(factory);
}

代码示例来源:origin: org.geotools/gt2-metadata

/**
 * Sets a new logger factory for this {@code Logging} instance and every children. The
 * specified factory will be used by <code>{@linkplain #getLogger getLogger}(name)</code>
 * when {@code name} is this {@code Logging} name or one of its children.
 */
public void setLoggerFactory(final LoggerFactory factory) {
  synchronized (EMPTY) {
    this.factory = factory;
    for (int i=0; i<children.length; i++) {
      children[i].setLoggerFactory(factory);
    }
    sameLoggerFactory = sameLoggerFactory(ALL.children, ALL.factory);
  }
}

代码示例来源:origin: org.geotools/gt-metadata

/**
 * Sets a new logger factory for this {@code Logging} instance and every children. The
 * specified factory will be used by <code>{@linkplain #getLogger(String) getLogger}(name)</code>
 * when {@code name} is this {@code Logging} name or one of its children.
 */
public void setLoggerFactory(final LoggerFactory factory) {
  synchronized (EMPTY) {
    this.factory = factory;
    for (int i=0; i<children.length; i++) {
      children[i].setLoggerFactory(factory);
    }
    sameLoggerFactory = sameLoggerFactory(ALL.children, ALL.factory);
  }
}

代码示例来源:origin: org.geotools/gt-metadata

setLoggerFactory(factory);

代码示例来源:origin: org.geotools/gt2-metadata

final Logging log = Logging.GEOTOOLS;
try {
  log.setLoggerFactory("org.geotools.util.logging.CommonsLoggerFactory");
} catch (ClassNotFoundException commonsException) {
  try {
    log.setLoggerFactory("org.geotools.util.logging.Log4JLoggerFactory");
  } catch (ClassNotFoundException log4jException) {

代码示例来源:origin: org.geotools/gt-metadata

final Logging log = Logging.GEOTOOLS;
try {
  log.setLoggerFactory("org.geotools.util.logging.CommonsLoggerFactory");
} catch (ClassNotFoundException commonsException) {
  try {
    log.setLoggerFactory("org.geotools.util.logging.Log4JLoggerFactory");
  } catch (ClassNotFoundException log4jException) {

代码示例来源:origin: org.geotools/gt2-metadata

setLoggerFactory(factory);

代码示例来源:origin: org.geoserver.community/gs-jms-geoserver

public GeoServerInstance(String instanceName) {
  try {
    // create this instance base data directory by copying the base test data
    dataDirectory = createTempDirectory(instanceName == null ? "INSTANCE" : instanceName);
    IOUtils.deepCopy(BASE_TEST_DATA.getDataDirectoryRoot(), dataDirectory);
    // disable security manager to speed up tests
    System.setSecurityManager(null);
    // take control of the logging
    Logging.ALL.setLoggerFactory(Log4JLoggerFactory.getInstance());
    System.setProperty(LoggingUtils.RELINQUISH_LOG4J_CONTROL, "true");
    // initialize Spring application context
    applicationContext = initInstance();
    // get some  JMS util beans
    jmsController = applicationContext.getBean(Controller.class);
    jmsQueueListener = applicationContext.getBean(JMSQueueListener.class);
    // set integration tests cluster name
    jmsController.setGroup(CLUSTER_NAME);
    saveJmsConfiguration();
  } catch (Exception exception) {
    throw new RuntimeException(
        String.format("Error instantiating GeoServer instance '%s'.", instanceName),
        exception);
  }
}

相关文章