Getting the Log Level of a Logger
This section helps you to learn about the getting log level of a logger through the java program and illustrates how to get it. The Logger provides various types of levels of a logger like: INFO, WARNING, SEVERE and FINEST etc.
In this section, an example is provided for the best illustration of the topic. In the following program, a object of the LogRecord class is created with the log level and the log message for the specific log record. And the last thing is getting log level and display it in the console.
Description of code:
LogRecord rec1 = new LogRecord(Level.WARNING,
"Do something here!"):
Here is the code of program: