darkSheep404 opened a new issue, #3358:
URL: https://github.com/apache/logging-log4j2/issues/3358
## Description
Log4j2 yml config do not support YAML Anchors and Aliases with error Logger
contains an invalid element or attribute "<<"
```
Configuration:
status: WARN
Appenders:
RollingFileTemplate: &RollingFileTemplate
ignoreExceptions: false
PatternLayout:
pattern: "[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%X{traceId},%X{spanId}]
[%pid] [%thread] %-5level %X{class}.%M - %msg%n"
Policies:
SizeBasedTriggeringPolicy:
size: "50 MB"
DefaultRolloverStrategy:
max: 200
RollingFile:
- name: XX_LOGGER_LOG
fileName: ./logs/xx/${env:HOSTNAME:-}/app/app.log
filePattern: "./logs/xx/${env:HOSTNAME:-}/app/app_%d{yyyy}-%i.log.gz"
<<: *RollingFileTemplate
Loggers:
Root:
level: INFO
AppenderRef:
- ref: CONSOLE_OUT_APPENDER
- ref: XX_LOGGER_LOG
```
```
main ERROR Unable to locate plugin for LoggerTemplate
2025-01-06T08:35:01.514260458Z 2025-01-06 08:35:01,514 main ERROR Logger
contains an invalid element or attribute "<<"
2025-01-06T08:35:01.514794013Z 2025-01-06 08:35:01,514 main ERROR Logger
contains an invalid element or attribute "<<"
2025-01-06T08:35:01.515709563Z 2025-01-06 08:35:01,515 main ERROR Logger
contains an invalid element or attribute "<<"
2025-01-06T08:35:01.516202917Z 2025-01-06 08:35:01,516 main ERROR Logger
contains an invalid element or attribute "<<"
2025-01-06 08:35:01,516 main ERROR Unable to invoke factory method in class
org.apache.logging.log4j.core.config.LoggersPlugin for element Loggers:
java.lang.NullPointerException
```
## Configuration
**Version:** [2.18.0]
**Operating system:** [redheat]
**JDK:** [JDK 8 ]
## Logs
```
[Stacktraces, errors, etc. relevant applications logs.]
```
## Reproduction
```
```
[An isolated test reproducing the test.
JUnit tests similar to the ones in the code base are extremely appreciated.]
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]