0

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?

khelwood
  • 55,782
  • 14
  • 81
  • 108
  • SLF4J don't work alone it need implementation like log4j or logback each of those has configuration files to configure whar are the logs to be printed. – seenukarthi Aug 16 '21 at 08:07

1 Answers1

0

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);
Jokkeri
  • 1,001
  • 1
  • 13
  • 35