有没有办法禁用此依赖项(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>
当我查看未暂存的文件时,我仍然可以看到 logs/ethereum.log 所以看起来这个 logback 仍然处于 Activity 状态,也许它包含在另一个依赖项中。如果存在 logback,我是否必须遍历所有依赖项并查找内部依赖项,或者是否有更好的方法?
最佳答案
似乎我已经通过放置 logback.xml 和 logback-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 创建的文件和定期创建的其他文件。
关于java - 如何禁用 Maven 中依赖项的任何类型的日志记录? [ logback,ethereumJ],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56093787/