Spring Boot Log4j2 isThreadContextMapInheritable設置一直不起做用!!!html
Log4j2 官網文檔:https://logging.apache.org/log4j/2.x/manual/configuration.html#SystemPropertiesjava
核心org.apache.logging.log4j.spi.DefaultThreadContextMap.javaapache
重點是給上圖圈圈裏變量賦值。System.setProperty("log4j2.isThreadContextMapInheritable", Boolean.toString(true))一直不起做用。htm
最終解決辦法:blog
紅圈圈1裏的內容必定要寫在紅圈圈2以前。文檔