Log4j2 doesnt escape " when using JSONLayout
Log4j2 doesnt escape " when using JSONLayout.
What I expected to happen was...:
Log4j2 should output this when using JSONLayout:
What actually happened was...:
Log4j2 actually outputs this:
- It does not escape double quotes within message.
Steps to Reproduce:
1. Download server.jar
2. Make the following log4j2.xml file:
<?xml version="1.0" encoding="UTF-8"?> <Configuration status="WARN" packages="net.minecraft,com.mojang"> <Appenders> <File name="jsonwrite" fileName="ex.json"> <JSONLayout/> </File> </Appenders> <Loggers> <Root level="info"> <filters> <MarkerFilter marker="NETWORK_PACKETS" onMatch="DENY" onMismatch="NEUTRAL" /> </filters> <AppenderRef ref="jsonwrite"/> </Root> </Loggers> </Configuration>
3. Start server with following command: java -Dlog4j.configurationFile=log4j2.xml -jar minecraft_server.jar nogui
4. Stop server
5. ex.json is not escaped correctly.