getName() method of a Logger class used to get the name of logger. Many times you have to check the logger name so we can use this method to get the logger name.
public String getName()
Parameters: This method accepts nothing.
Return value: This method return logger name and it will be null for anonymous Loggers.
Below programs illustrate the getName() method:
logger1 name = global logger2 name = com.gfg
logger name = com.gfg.logger.
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.