Thursday, January 22, 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

1 COMMENT

Most Popular

Dominic
32475 POSTS0 COMMENTS
Milvus
119 POSTS0 COMMENTS
Nango Kala
6847 POSTS0 COMMENTS
Nicole Veronica
11977 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12064 POSTS0 COMMENTS
Shaida Kate Naidoo
6986 POSTS0 COMMENTS
Ted Musemwa
7221 POSTS0 COMMENTS
Thapelo Manthata
6934 POSTS0 COMMENTS
Umr Jansen
6912 POSTS0 COMMENTS