Log4J 2 supports custom log levels. Custom log levels can be defined in code or in configuration.
To create custom log levels in configuration (log4j.xml), use the following example snippet,
<CustomLevels>
<CustomLevel name="CUSTOM" intLevel="350" />
</CustomLevels>
The intLevel parameter (350 in the example above) determines where the custom level exists in relation to the standard levels built-in to Log4J 2.
In your case,
since you need a log level above DEBUG and less than TRACE, use the following code snippet in log4j.xml
<CustomLevels>
<CustomLevel name="CUSTOM" intLevel="550" />
</CustomLevels>
Since the intLevel of DEBUG is 500 and TRACE is 600 (according to Log4J 2), we have set the intLevel for the custom log level as 550.
For more information, refer the following link,
https://logging.apache.org/log4j/2.x/manual/customloglevels.html
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…