Where is the correct location to put Log4j.properties in an Eclipse project?

后端 未结 10 1626
伪装坚强ぢ
伪装坚强ぢ 2020-11-27 11:19

Where in my Eclipse project should I add the log4j.properties file so that it will work as intended?

10条回答
  •  忘掉有多难
    2020-11-27 11:57

    This question is already answered here

    The classpath never includes specific files. It includes directories and jar files. So, put that file in a directory that is in your classpath.

    Log4j properties aren't (normally) used in developing apps (unless you're debugging Eclipse itself!). So what you really want to to build the executable Java app (Application, WAR, EAR or whatever) and include the Log4j properties in the runtime classpath.

提交回复
热议问题