Logger getResourceBundle() Method in Java with Examples Last Updated : 03 Jun, 2021 Comments Improve Suggest changes Like Article Like Report getResourceBundle() method of a Logger class is used to localise resource bundle for this logger. We can set ResourceBundle either by the setResourceBundle method or mapped from the resource bundle name set via the getLogger factory method for the current default locale and this method will return a ResourceBundle set by above-mentioned ways. If the result is null, then the Logger will use a resource bundle or resource bundle name inherited from its parent.Syntax: public ResourceBundle getResourceBundle() Parameters: This method accepts nothing.Return value: This method return localization bundle.Below programs illustrate the getResourceBundle() method: Program 1: Java // Java program to demonstrate // Logger.getParent() method import java.util.logging.*; import java.util.ResourceBundle; public class GFG { private static Logger logger = Logger.getLogger( String .class .getPackage() .getName()); public static void main(String args[]) { logger.info("printing the message..."); ResourceBundle rs = logger.getResourceBundle(); logger.info("Resource Bundle " + rs); } } Output: The output printed on eclipse IDE shown below- Program 2: Java // Java program to demonstrate // Logger.getParent() method import java.util.logging.*; import java.util.ResourceBundle; public class GFG { private static Logger logger = Logger.getLogger( GFG .class .getPackage() .getName()); public static void main(String args[]) { // Create ResourceBundle using getBundle // myResource is a properties file ResourceBundle bundle = ResourceBundle .getBundle("myResource"); // Set ResourceBundle to logger logger.setResourceBundle(bundle); // Get ResourceBundle from logger ResourceBundle rs = logger.getResourceBundle(); // Log the ResourceBundle details logger.info("Resource Bundle " + rs.getBaseBundleName()); } } For above program there is a properties file name myResource. we have to add this file along side the class to execute the program. Output: The output printed on eclipse IDE shown below- Reference: https://docs.oracle.com/javase/10/docs/api/java/util/logging/Logger.html#getResourceBundle() Comment More infoAdvertise with us Next Article Logger getResourceBundle() Method in Java with Examples A AmanSingh2210 Follow Improve Article Tags : Java Java - util package Java-Functions Java-Logger Practice Tags : Java Similar Reads Logger getResourceBundleName() method in Java with Examples getResourceBundleName() method of a Logger class is used to retrieve the localization resource bundle name for this logger.We can set ResourceBundle either by the setResourceBundle method or mapped from the resource bundle name set via the getLogger factory method for the current default locale. Thi 2 min read LogRecord getResourceBundle() method in Java with Examples The getResourceBundle() method of java.lang.reflect.LogRecord is used to get the localization resource bundle.Resource bundle used to localize the message of this LogRecord. Syntax: public ResourceBundle getResourceBundle() Parameters: This method accepts nothing. Return: This method returns the loc 1 min read LogRecord getResourceBundleName() method in Java with Examples The getResourceBundleName() method of java.lang.reflect.LogRecord is used to get the localization resource bundle name. Syntax: public String getResourceBundleName() Parameters: This method accepts nothing. Return: This method returns the localization resource bundle name. Below programs illustrate 1 min read Level getResourceBundleName() method in Java with Examples The getResourceBundleName() method of java.util.logging.Level is used to get the localization resource bundle name of this level object. If localization bundle is present then this method returns name of bundle else method return null. Syntax: public String getResourceBundleName() Parameters: This m 2 min read Logger getHandler() Method in Java with Examples The getHandlers() method of the Logger class is used to get the Handlers linked with this logger. Handler is used to taking care of the actual logging. one or more Handler can be added to a Logger. When messages are logged via the Logger, the messages are forwarded to the Handler. This method is hel 2 min read Like