LogRecord getLevel() method in Java with Examples Last Updated : 14 Oct, 2019 Comments Improve Suggest changes Like Article Like Report The getLevel() method of java.util.logging.LogRecord is used to get the logging message level of this current LogRecord object, for example Level.Info. Syntax: public Level getLevel() Parameters: This method accepts nothing. Return: This method returns the logging message level. Below programs illustrate getLevel() method: Program 1: Java // Java program to illustrate getLevel() 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("400"), "Hi message"); // get level of LogRecord Level lvl = logRecord.getLevel(); // print result System.out.println("Level of Log Record = " + lvl); } } Output: Level of Log Record = FINER Program 2: Java // Java program to illustrate getLevel() 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("WARNING"), "Some Warning Message"); // get level of LogRecord Level lvl = logRecord.getLevel(); // print result System.out.println("Level of Log Record = " + lvl); } } Output: Level of Log Record = WARNING References: https://docs.oracle.com/javase/10/docs/api/java/util/logging/LogRecord.html#getLevel() Comment More infoAdvertise with us Next Article LogRecord getLevel() 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 Logger getLevel() method in Java with Examples The getLevel() method of the Logger class in Java is used to get the log Level that has been specified for this Logger instance. Every Logger has specific log levels and if the result is null, which means that this logger's effective level will be inherited from its parent. Log Levels: The log level 2 min read LogRecord getMillis() method in Java with Examples The getMillis() method of java.lang.reflect.LogRecord is used to get the event time in LogRecord.This event time has unit in MilliSeconds since 1970. Syntax: public long getMillis() Parameters: This method accepts nothing. Return: This method returns truncated event time in millis since 1970. Below 2 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 getThreadID() method in Java with Examples The getThreadID() method of java.lang.reflect.LogRecord is used to get an identifier for the thread where the message originated. This method is helpful to identify thread which generates the logger message. Syntax: public int getThreadID() Parameters: This method accepts nothing. Return: This metho 2 min read Like