Friday, April 3, 2026
HomeLanguagesJavaLevel getLocalizedName() method in Java with Examples

Level getLocalizedName() method in Java with Examples

The getLocalizedName() method of java.util.logging.Level is used to get the localized string name of the Level.This method returns localized name, for the current default locale. If no localization information is available, the non-localized name is returned.

Syntax:

public String getLocalizedName()

Parameters: This method accepts nothing.

Return: This method returns localized name of this Level.

Below programs illustrate getLocalizedName() method:
Program 1:




// Java program to illustrate
// getLocalizedName() method
  
import java.util.logging.Level;
import java.util.logging.Logger;
  
public class GFG {
  
    public static void main(String[] args)
    {
  
        // Create a Logger
        Logger logger
            = Logger.getLogger(
                        Object.class.getName())
                  .getParent();
  
        // Get level of logger
        Level level
            = logger.getLevel();
  
        // get Level localized name
        String name = level.getLocalizedName();
  
        // print level localized name
        System.out.println("Localized Name = "
                           + name);
    }
}


Output:

Localized Name = INFO

Program 2:




// Java program to illustrate
// getLocalizedName() method
  
import java.util.logging.Level;
  
public class GFG {
  
    public static void main(String[] args)
    {
  
        // Get level of logger
        Level level
            = Level.parse("SEVERE");
  
        // get Level Localized name
        String name = level.getLocalizedName();
  
        // print level names
        System.out.println("Localized Name = "
                           + name);
    }
}


Output:

Localized Name = SEVERE

References: https://docs.oracle.com/javase/10/docs/api/java/util/logging/Level.html#getLocalizedName()

RELATED ARTICLES

2 COMMENTS

Most Popular

Dominic
32512 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6886 POSTS0 COMMENTS
Nicole Veronica
12007 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12100 POSTS0 COMMENTS
Shaida Kate Naidoo
7015 POSTS0 COMMENTS
Ted Musemwa
7259 POSTS0 COMMENTS
Thapelo Manthata
6972 POSTS0 COMMENTS
Umr Jansen
6960 POSTS0 COMMENTS