在Spring Boot Web应用程序中调试log4j配置 [英] Debug log4j Configuration in a spring boot webapplication

查看:88
本文介绍了在Spring Boot Web应用程序中调试log4j配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发带有Spring Boot的多模块Webapp.我的Web应用程序始终从dependend子模块中获取log4j配置,这是不希望的.有没有显示调试信息的方法,使用了哪个logback或log4j文件?

I am developing a multimodule webapp with spring boot. My webapplication always takes the log4j config from the dependend submodule, which is not desired. Is there a way to show debug info, which logback or log4j file is used?

推荐答案

您需要通过将默认值添加到pom来排除默认值

You need to exclude default by adding these to pom

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

这篇关于在Spring Boot Web应用程序中调试log4j配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆