LogManager getLogger() method in Java with Examples
The getLogger() method of java.util.logging.LogManager is used to get the specified Logger in this LogManager instance. This Logger must be a named Logger. This method will get this Logger in this LogManager if it exists. If it does not exists, then this method returns null.
public Logger getLogger(Logger logger)
Parameters: This method accepts a parameter logger which is the name of the Logger to be get in this LogManager instance.
Return Value: This method returns the name of this Logger in this LogManager if it exists. If it does not exists, then this method returns null.
Below programs illustrate getLogger() method:
List of Logger Names: GFG global Get Logger Name GFG: java.util.logging.Logger@1540e19d Get Logger Name Geeks: null
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.