Loading a configuration file from the classpath

前端 未结 4 1814
眼角桃花
眼角桃花 2020-12-17 04:43

I\'m working on making my Java app easy to deploy to other computers and am writing an ant script to do so, that is going fine.

I\'m having trouble loading resources

4条回答
  •  Happy的楠姐
    2020-12-17 04:55

    Regarding log4j : If you want it to use a different config file from the default, you can use

    org.apache.log4j.PropertyConfigurator.configure(...)
    

    Variants of this static method accept URL, Properties or file name.

    There is also

    org.apache.log4j.xml.DOMConfigurator
    

    for the XML files.

提交回复
热议问题