1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.logging.log4j.core.config.yaml;
18
19 import org.apache.logging.log4j.core.config.ConfigurationSource;
20 import org.apache.logging.log4j.core.config.json.JsonConfiguration;
21
22 import com.fasterxml.jackson.core.JsonParser;
23 import com.fasterxml.jackson.databind.ObjectMapper;
24 import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
25
26 public class YamlConfiguration extends JsonConfiguration {
27
28 private static final long serialVersionUID = 1L;
29
30 public YamlConfiguration(final ConfigurationSource configSource) {
31 super(configSource);
32 }
33
34 @Override
35 protected ObjectMapper getObjectMapper() {
36 return new ObjectMapper(new YAMLFactory()).configure(JsonParser.Feature.ALLOW_COMMENTS, true);
37 }
38
39 }