在ubuntu的classpath中设置log4j

时间:2012-11-09 08:56:46

标签: java log4j

如何在maven项目中将log4j添加到我的类路径中 org.apache.log4j.PropertyConfigurator.configure( “log4j.properties”); 给我错误

log4j:ERROR Could not read configuration file [log4j.properties].
java.io.FileNotFoundException: log4j.properties (No such file or directory)

1 个答案:

答案 0 :(得分:1)

您通常会将这些属性文件添加到maven项目的src/main/resources文件夹中,并将其包含在pom.xml的构建属性中:

<build>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
        </resource>
    </resources>
</build>