Spring Boot Log4j2 isThreadContextMapInheritable设置一直不起作用!!!
Log4j2 官网文档:https://logging.apache.org/log4j/2.x/manual/configuration.html#SystemProperties
核心org.apache.logging.log4j.spi.DefaultThreadContextMap.java
重点是给上图圈圈里变量赋值。System.setProperty("log4j2.isThreadContextMapInheritable", Boolean.toString(true))一直不起作用。
最终解决办法:
红圈圈1里的内容一定要写在红圈圈2之前。