why is Log4j trying to find log4j.dtd

前端 未结 6 675
时光取名叫无心
时光取名叫无心 2021-02-08 01:21

I\'m getting an exception when I try to run my application (in eclipse) complaining about log4j.dtd. Am I meant to have a dtd file if I use the xml configuration for log4j?

6条回答
  •  故里飘歌
    2021-02-08 02:12

    If you use an XML file as log4j configuration file, look in the DOCTYPE tag and you will find something like this:

    
    

    So you need that DTD file, because it is the definition of the structure of your XML.

    Anyway you can use a properties file as configuration file, instead of an XML.

    EDIT: I've just found a correlated question that could help you: Eclipse: Referencing log4j.dtd in log4j.xml

提交回复
热议问题