Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

LogManager readConfiguration() method in Java with Examples

  • Last Updated : 26 Sep, 2021

The readConfiguration() method of java.util.logging.LogManager is used to read and initialize the default configuration. This method throws IOException and SecurityException if the exception condition occurs, as given below


Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more,  please refer Complete Interview Preparation Course.

public void readConfiguration()
  throws IOException, SecurityException

Parameters: This method does not accepts any parameter.
Return Value: This method does not return anything. It just reads and initializes the logging configuration.
Exceptions: This method throws following exceptions:  

  • IOException: if any IO error occurs while reading the configuration.
  • SecurityException: if a security manager exists while the caller does not have logging permissions.

Below programs illustrate readConfiguration() method: 


// Java program to illustrate
// LogManager readConfiguration() method
import java.util.logging.*;
import java.util.*;
public class GFG {
    public static void main(String[] args)
        try {
            // Create LogManager object
            LogManager logManager
                = LogManager.getLogManager();
            System.out.println("LogManager: "
                               + logManager);
                "Reading the configuration "
                + "using readConfiguration() method");
        catch (Exception e) {
LogManager: java.util.logging.LogManager@1540e19d 
Reading the configuration using readConfiguration() method access denied (“java.util.logging.LoggingPermission” “control”) 


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!