Tomas Bisciak
Tomas Bisciak

Reputation: 2841

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

Is there a way to disable all internal logging in this dependency (ethereumj) ?

Currently seems like its still loggin something.

What i did to combat this was exclude logback dependency (Im using 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 when i look at unstaged files I can still see logs/ethereum.log So looks like this logback is still active maybe its included from another dependency. Do i have to go thru all dependencies i have and look for internal dependencies if logback is present or is there some better way?

enter image description here

Upvotes: 1

Views: 2936

Answers (1)

Tomas Bisciak
Tomas Bisciak

Reputation: 2841

Seems like i have solved this by putting logback.xml and logback-detailed.xml

into src/main/resources/

With data :

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>

Seems like it overriden what was configured by dependency and i got rid of file created by logback and additional files that were created periodically.

Upvotes: 2

Related Questions