public void start()

in src/main/java/com/googlesource/gerrit/plugins/loglevel/LogLevel.java [36:55]


  public void start() {
    log.info("Plug-in started");
    Properties config = new Properties();
    Path pluginConfig = sitePaths.etc_dir.resolve(pluginName + ".properties");
    try (InputStream in = Files.newInputStream(pluginConfig)) {
      config.load(in);
    } catch (NoSuchFileException e) {
      log.warn("Configuration file " + pluginConfig + " not found");
    } catch (IOException e) {
      log.error("Error loading config file " + pluginConfig, e);
    }

    for (String name : config.stringPropertyNames()) {
      String cfgLevel = config.getProperty(name);
      Logger logger = Logger.getLogger(name);
      Level level = Level.toLevel(cfgLevel, Level.INFO);
      logger.setLevel(level);
      log.info(name + "=" + level.toString());
    }
  }