Monday, June 15, 2026
HomeLanguagesJavaLogManager getProperty() method in Java with Examples

LogManager getProperty() method in Java with Examples

The getProperty() method of java.util.logging.LogManager is used to get the value of the specified propertyName in this LogManager instance. This method will get this property in this LogManager if it exists. If it does not exists, then this method returns null.

Syntax:

public String getProperty(String propertyName)

Parameters: This method accepts a parameter propertyName which is the name of the property to be get in this LogManager instance.

Return Value: This method returns the name of this property in this LogManager if it exists. If it does not exists, then this method returns null.

Below programs illustrate getProperty() method:




// Java program to illustrate
// LogManager getProperty() method
  
import java.util.logging.*;
import java.util.*;
  
public class GFG {
  
    public static void main(String[] args)
    {
  
        // Create LogManager object
        LogManager logManager
            = LogManager.getLogManager();
  
        String propertyName = "GFG";
        System.out.println(
            "\nGet Property value of "
            + propertyName + ": "
            + logManager.getProperty(propertyName));
  
        propertyName = "Global";
        System.out.println(
            "\nGet Property value of "
            + propertyName + ": "
            + logManager.getProperty(propertyName));
    }
}


Output:

Get Property value of GFG: null

Get Property value of Global: null

Reference: https://docs.oracle.com/javase/9/docs/api/java/util/logging/LogManager.html#getProperty-java.lang.String-

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

2 COMMENTS

Most Popular

Dominic
32516 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6897 POSTS0 COMMENTS
Nicole Veronica
12013 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12109 POSTS0 COMMENTS
Shaida Kate Naidoo
7019 POSTS0 COMMENTS
Ted Musemwa
7262 POSTS0 COMMENTS
Thapelo Manthata
6976 POSTS0 COMMENTS
Umr Jansen
6964 POSTS0 COMMENTS