I have an Java app that depends on a whole bunch of libraries. I use the assembly maven plugin to package the whole thing into a single JAR.
This library is mostly used a regular JAR dependency, so the client will be controlling logging. However, when it's packaged as a standalone executable JAR, I don't want to show all these logs that you would usually see in the server log.
I obviously don't control what type of logging libraries dependencies use. In my main
, I use the JDK java.util.logging
.
How do I programmatically turn off all logging (or leave it only at SEVERE
level)?
I have tried to do what is suggested here (with the variation that I set the level to SEVERE
) at the very start in my main
, but all the logs are still showing up.
How do I get the logs to stop showing up on the command-line when I execute the JAR?