我正在爲我的項目使用log4j。當我使用罐子時它不工作。當我加入了虛擬機ARG -Dlog4j.debug=true
我的調試配置,我得到了這一點 -Log4j無法正常工作
log4j: Trying to find [log4j.xml] using context classloader [email protected]
log4j: Using URL [jar:file:/C:/Users/modia1/.m2/repository/ca/uhn/hapi/hapi-hl7overhttp/2.2/hapi-hl7overhttp-2.2.jar!/log4j.xml] for automatic log4j configuration.
log4j: Preferred configurator class: org.apache.log4j.xml.DOMConfigurator
log4j: System property is :null
log4j: Standard DocumentBuilderFactory search succeded.
log4j: DocumentBuilderFactory is: com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
log4j: debug attribute= "null".
log4j: Ignoring debug attribute.
log4j: reset attribute= "false".
log4j: Threshold ="null".
log4j: Level value for root is [debug].
log4j: root level set to DEBUG
log4j: Class name: [org.apache.log4j.ConsoleAppender]
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [%d{ABSOLUTE} %5p [%t] %c{1}:%L - %m%n].
log4j: Adding appender named [stdout] to category [root].
但我已經把log4j屬性中的src/main /資源&項目文件夾中。但它仍然使用其他一些記錄器配置。我怎樣才能使用我的屬性文件?
您可以將屬性文件放在'/ resources'目錄中。 –