1

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

Tomas Bisciak
  • 2,801
  • 5
  • 33
  • 57
  • 2
    In logback.xml, you can disable logging from packages. – Sambit May 11 '19 at 19:56
  • @Sambit Ah ok so i have to explicitly create config file for this, Can I forbid project wide logback logging? – Tomas Bisciak May 11 '19 at 20:01
  • 1
    In your existing logback.xml file, write the package names from which you do not want to see the loggings. – Sambit May 11 '19 at 20:03
  • 1
    You can refer below the old stackoverflow links. https://stackoverflow.com/questions/47397442/disable-the-log-from-specific-class-jar-via-logback-xml https://stackoverflow.com/questions/36086304/package-specific-logging-levels-for-different-logback-appenders?rq=1 – Sambit May 11 '19 at 20:05
  • @Sambit I also want to prevent from the ethereum.log file from beign created, is that possible within that configuration? – Tomas Bisciak May 11 '19 at 20:05
  • May be, ethereum jar file has the log configuration to log the details. I do not know, but you search. However, you can minimize the logging by making as error type in logback.xml so that it will not log everything. – Sambit May 11 '19 at 20:09
  • @Sambit Alright, thanks this points me the right way to get rid of this annoyance :) – Tomas Bisciak May 11 '19 at 20:10
  • What is the reason you don't want this particular file to be written? – Thorbjørn Ravn Andersen Jun 02 '19 at 21:32

1 Answers1

2

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.

Tomas Bisciak
  • 2,801
  • 5
  • 33
  • 57
  • Bud be carefull, rather dont disable everything cause other dependencies also use it. And you will end up with no logs what so ever, sometimes it can be desired bud :D sometimes its not. – Tomas Bisciak May 12 '19 at 12:13