public static void writeSettingsToStream(Settings settings, StreamOutput out) throws IOException {
   out.writeVInt(settings.getAsMap().size());
   for (Map.Entry<String, String> entry : settings.getAsMap().entrySet()) {
     out.writeString(entry.getKey());
     out.writeString(entry.getValue());
   }
 }
 @Override
 public Settings getValue(Settings current, Settings previous) {
   Settings.Builder builder = Settings.builder();
   builder.put(current.filter(loggerPredicate).getAsMap());
   for (String key : previous.getAsMap().keySet()) {
     if (loggerPredicate.test(key) && builder.internalMap().containsKey(key) == false) {
       if (ESLoggerFactory.LOG_LEVEL_SETTING.getConcreteSetting(key).exists(settings) == false) {
         builder.putNull(key);
       } else {
         builder.put(
             key, ESLoggerFactory.LOG_LEVEL_SETTING.getConcreteSetting(key).get(settings));
       }
     }
   }
   return builder.build();
 }
 @Override
 public void apply(Settings value, Settings current, Settings previous) {
   for (String key : value.getAsMap().keySet()) {
     assert loggerPredicate.test(key);
     String component = key.substring("logger.".length());
     if ("level".equals(component)) {
       continue;
     }
     if ("_root".equals(component)) {
       final String rootLevel = value.get(key);
       if (rootLevel == null) {
         Loggers.setLevel(
             ESLoggerFactory.getRootLogger(),
             ESLoggerFactory.LOG_DEFAULT_LEVEL_SETTING.get(settings));
       } else {
         Loggers.setLevel(ESLoggerFactory.getRootLogger(), rootLevel);
       }
     } else {
       Loggers.setLevel(ESLoggerFactory.getLogger(component), value.get(key));
     }
   }
 }
 /** Sets all the provided settings. */
 public Builder put(Settings settings) {
   map.putAll(settings.getAsMap());
   classLoader = settings.getClassLoaderIfSet();
   return this;
 }