LogManager getProperty MyClass.filter in java

234 Views Asked by At

I have create the following code in java :

LogManager manager = LogManager.getLogManager();
String className = this.getClass().getName();
String level = manager.getProperty(className + ".filter");

nevertheless, the variable is null after the call to getProperty, but className has the name : "view.frame.WindowHandler"

Any ideas ? Thank you very much

1

There are 1 best solutions below

0
On BEST ANSWER

You have to define an entry that is loaded by the LogManager configuration. The default logging configuration file located in lib/logging.properties in the JRE directory. Add the following entries to the logging.properties file:

#WindowHandler settings
view.frame.WindowHandler.level = INFO
view.frame.WindowHandler.filter = some.filter.class.Name

You should create your own logging.properties file and set the java.util.logging.config.file system property to configure the LogManager for your application.