使用log4.properties文件的Spring引导日志记录不工作

使用log4.properties文件的Spring引导日志记录不工作,spring,spring-boot,log4j,Spring,Spring Boot,Log4j,我在resources文件夹下有log4j.properties文件。现在我在application.properties文件中传递logging.file=/Users/jkurakos/web/rnt/dr/rnt.log。 如何使用log4j.properties文件从log4j.properties文件加载所有信息(如smtp服务器等)?从pom文件中排除spring boot starter日志,并添加以下依赖项: <dependency> <

我在resources文件夹下有log4j.properties文件。现在我在application.properties文件中传递logging.file=/Users/jkurakos/web/rnt/dr/rnt.log。
如何使用log4j.properties文件从log4j.properties文件加载所有信息(如smtp服务器等)?

从pom文件中排除spring boot starter日志,并添加以下依赖项:

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-log4j</artifactId>
    </dependency>

org.springframework.boot

从pom文件中排除spring boot starter日志记录,并添加以下依赖项:

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-log4j</artifactId>
    </dependency>

org.springframework.boot

谢谢。我通过将它添加到build.gradle类似的配置{all*.exclude module:'spring boot starter logging'}中,并通过将compile('org.springframework.boot:spring-boot-starter-log4j')添加到依赖项中来修复它。现在我有另一个问题。如何从主类中排除相同的内容。下面是我的主课@SpringBootApplication公共类应用程序{public static void main(String[]args)引发异常{SpringApplication.run(Application.class);}}谢谢。我通过将它添加到build.gradle类似的配置{all*.exclude module:'spring boot starter logging'}中,并通过将compile('org.springframework.boot:spring-boot-starter-log4j')添加到依赖项中来修复它。现在我有另一个问题。如何从主类中排除相同的内容。下面是我的主课@SpringBootApplication公共类应用程序{public static void main(字符串[]args)引发异常{SpringApplication.run(Application.class);}