如何禁用 Maven 中依赖项的任何类型的日志记录? [ logback,ethereumJ]

How to disable any kind of logging from dependency in maven? [ logback,ethereumJ]

有没有办法禁用此依赖项 (ethereumj) 中的所有内部日志记录?

目前好像还在登录。

我为解决这个问题所做的是排除 logback 依赖性 (我使用的是 maven) :

 <!-- https://mvnrepository.com/artifact/org.ethereum/ethereumj-core -->
    <dependency>
        <groupId>org.ethereum</groupId>
        <artifactId>ethereumj-core</artifactId>
        <version>1.12.0-RELEASE</version>
        <exclusions>
            <exclusion>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-core</artifactId>
            </exclusion>
            <exclusion>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
            </exclusion>
            <exclusion>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-parent</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

Bud 当我查看未暂存的文件时,我仍然可以看到 logs/ethereum.log 所以看起来这个 logback 仍然处于活动状态,可能它包含在另一个依赖项中。如果存在 logback 或有更好的方法,我是否必须检查我拥有的所有依赖项并寻找内部依赖项?

看来我已经通过放置 logback.xmllogback-detailed.xml 解决了这个问题

变成src/main/resources/

有数据:

logback.xml

    <?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <logger name="org.ethereum.*" level="OFF"/> Not sure if it really does anything. Bud works.
    <logger name="*" level="OFF"/>
</configuration>

logback-details.xml

<?xml version="1.0" encoding="UTF-8"?>
<configuration>

</configuration>

似乎它覆盖了依赖项配置的内容,我摆脱了 logback 创建的文件和定期创建的其他文件。