I use a legacy library that writes logs using log4j. My default log4j.properties file directs the log to the console, but in some specific functions of my main program, I would
If you wanna achieve perfect silence (like for a quiet command line tool), you can always use the NullAppender.
Logger.getRootLogger().removeAllAppenders(); Logger.getRootLogger().addAppender(new NullAppender());