How to turn off (disable) java.util.logging

If you need to turn off (disable) java.util.logging logging, adding this line of code to your main method seems to work:


The LogManager class is located at java.util.logging.LogManager. I just put this code in the main method of a new project, where my project uses a library named Easy Rules that writes output via the java.util.logging library. After I implemented this LogManager approach I found that there was another way to turn off logging, but until then I can confirm that this approach worked.

I’m sure that you can also disable logging with a configuration file, but for my purposes I didn’t want to have to deal with that, I wanted to be able to disable it within my application, and this approach worked.