javaloggingsshj

how to avoid or disable default logging of sshj library


I'm using SSHJ library to transfer files over sftp. I took help from the follwing blog: https://www.baeldung.com/java-file-sftp

When I run the program it was throwing some sl4j issues, so I added sl4j dependencies in my project and added the BasicConfigurator in my code BasicConfigurator.configure();. Now it is printing everything on console. I want to disable that logging or log the sshj related log to another log file. How can I do that?


Solution

  • It' been a while since I played with this but I think this is the key (and of course this can be done with configuration files):

            final Logger app = Logger.getLogger("net.schmizz");
            app.setLevel(Level.WARNING);