LogRecord getSourceClassName() method in Java with Examples Last Updated : 23 Oct, 2019 Comments Improve Suggest changes Like Article Like Report The getSourceClassName() method of java.lang.reflect.LogRecord is used to get the name of the class that allegedly issued the logging request. The source class name which is used in logRecord for logging purpose. Syntax: public String getSourceClassName() Parameters: This method accepts nothing. Return: This method returns the source class name. Below programs illustrate getSourceClassName() method: Program 1: Java // Java program to illustrate // getSourceClassName() method import java.util.logging.Level; import java.util.logging.LogRecord; public class GFG { public static void main(String[] args) { // Create LogRecord object LogRecord logRecord = new LogRecord( Level.parse("800"), "Hi Logger"); logRecord.setSourceClassName( String.class.getName()); // get source class name String sourceClass = logRecord.getSourceClassName(); // print the class name System.out.println( "Source class Name = " + sourceClass); } } Output: Source class Name = java.lang.String Program 2: Java // Java program to illustrate // getSourceClassName() method import java.util.logging.Level; import java.util.logging.LogRecord; public class GFG { public static void main(String[] args) { // Create LogRecord object LogRecord logRecord = new LogRecord( Level.parse("600"), "GFG Logger"); logRecord.setSourceClassName( Object.class.getName()); // get source class name String sourceClass = logRecord.getSourceClassName(); // print the class name System.out.println( "Source class Name = " + sourceClass); } } Output: Source class Name = java.lang.Object References: https://docs.oracle.com/javase/10/docs/api/java/util/logging/LogRecord.html#getSourceClassName() Comment More infoAdvertise with us Next Article LogRecord getSourceClassName() method in Java with Examples A AmanSingh2210 Follow Improve Article Tags : Java Java-Functions Java-LogRecord java.util.logging package Practice Tags : Java Similar Reads 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 LogRecord getSourceMethodName() method in Java with Examples The getSourceMethodName() method of java.lang.reflect.LogRecord is used to get the name of the method that allegedly issued the logging request. The source method which is used in logRecord for logging purpose. Syntax: public String getSourceMethodName() Parameters: This method accepts nothing. Retu 1 min read LogRecord getMessage() method in Java with Examples The getMessage() method of java.util.logging.LogRecord is used to get the actual log message, before localization or formatting from this logRecord.This message may be null, which is equivalent to the empty string "". This returned message may be either the final text or a localization key. Syntax: 2 min read LogRecord getLoggerName() method in Java with Examples The getLoggerName() method of java.util.logging.LogRecord is used to get the logger name of source.This method returns source logger name if present else returns null. Syntax: public String getLoggerName() Parameters: This method accepts nothing. Return: This method returns source logger name if pre 1 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 Like