Eclipse: Referencing log4j.dtd in log4j.xml

后端 未结 6 1783
既然无缘
既然无缘 2020-11-30 20:21

I\'ve been using log4j for quite a while now and I usually use this at the top of the log4j.xml (probably just like many others and according to Google this is the

6条回答
  •  自闭症患者
    2020-11-30 20:31

    @Jack Leow uses a good approach with the PUBLIC ID. Yet, as he points out, it requires a network connection.

    I prefer a combination:

    Entry element:      Public
    Location:           org\apache\log4j\xml\log4j.dtd in jar file C:\Development\lib\external\apache-log4j-1.2.17\log4j-1.2.17.jar
    URI:                jar:file:/C:/Development/lib/external/apache-log4j-1.2.17/log4j-1.2.17.jar!/org/apache/log4j/xml/log4j.dtd
    Key type:           Public ID
    Key:                -//APACHE//DTD LOG4J 1.2//EN
    

    This references a local JAR, and supports a DOCTYPE declaration without the full URL.

    
    

提交回复
热议问题