💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# 73.2.1 使用YAML或JSON配置Log4j2 除了它的默认XML配置格式,Log4j 2也支持YAML和JSON配置文件。想使用其他配置文件格式配置Log4j 2,你需要添加合适的依赖到classpath,并以匹配所选格式的方式命名配置文件: | 格式 | 依赖 | 文件名 | | :--- | :--- | :--- | | YAML | `com.fasterxml.jackson.core:jackson-databind` `com.fasterxml.jackson.dataformat:jackson-dataformat-yaml` | `log4j2.yaml` `log4j2.yml` | | JSON | `com.fasterxml.jackson.core:jackson-databind` | `log4j2.json` `log4j2.jsn` |