org.apache.logging.log4j.core.config.Configuration.getWatchManager()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(185)

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

Configuration.getWatchManager介绍

[英]Return the WatchManager.
[中]返回WatchManager。

代码示例

代码示例来源:origin: org.apache.logging.log4j/log4j-core

TimeUnit.SECONDS.sleep(config.getWatchManager().getIntervalSeconds()+1);
for (int i = 0; i < 17; ++i) {
  logger.debug("Test message " + i);

代码示例来源:origin: mulesoft/mule

private void configureMonitor(MuleLoggerContext context) {
 Configuration configuration = context.getConfiguration();
 File configFile = null;
 if (context.getConfigFile() != null) {
  configFile = new File(context.getConfigFile().getPath());
 } else if (!StringUtils.isEmpty(configuration.getName())) {
  configFile = new File(configuration.getName());
 }
 if (configFile != null && configuration instanceof Reconfigurable) {
  configuration.getWatchManager().setIntervalSeconds(DEFAULT_MONITOR_INTERVAL_SECS);
  FileWatcher watcher = new ConfiguratonFileWatcher((Reconfigurable) configuration, getListeners(configuration));
  configuration.getWatchManager().watchFile(configFile, watcher);
 }
}

代码示例来源:origin: org.mule.runtime/mule-module-launcher

private void configureMonitor(MuleLoggerContext context) {
 Configuration configuration = context.getConfiguration();
 File configFile = null;
 if (context.getConfigFile() != null) {
  configFile = new File(context.getConfigFile().getPath());
 } else if (!StringUtils.isEmpty(configuration.getName())) {
  configFile = new File(configuration.getName());
 }
 if (configFile != null && configuration instanceof Reconfigurable) {
  configuration.getWatchManager().setIntervalSeconds(DEFAULT_MONITOR_INTERVAL_SECS);
  FileWatcher watcher = new ConfiguratonFileWatcher((Reconfigurable) configuration, getListeners(configuration));
  configuration.getWatchManager().watchFile(configFile, watcher);
 }
}

代码示例来源:origin: org.mule.modules/mule-module-launcher

private void configureMonitor(MuleLoggerContext context)
{
  Configuration configuration = context.getConfiguration();
  File configFile = null;
  if (context.getConfigFile() != null)
  {
    configFile = new File(context.getConfigFile().getPath());
  }
  else if (!StringUtils.isEmpty(configuration.getName()))
  {
    configFile = new File(configuration.getName());
  }
  if (configFile != null && configuration instanceof Reconfigurable)
  {
    configuration.getWatchManager().setIntervalSeconds(DEFAULT_MONITOR_INTERVAL_SECS);
    FileWatcher watcher = new ConfiguratonFileWatcher((Reconfigurable) configuration, getListeners(configuration));
    configuration.getWatchManager().watchFile(configFile, watcher);
  }
}

相关文章