Logger finest() method in Java with Examples Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report The finest() method of a Logger class used to Log an FINEST message.This method is used to pass FINEST types logs to all the registered output Handler objects. FINEST message: FINEST provides highly detailed tracing message. There are two types of finest() method depending upon the number of the parameters passed. finest(String msg): This method is used to log a FINEST message.If the logger is enabled for logging FINEST level message then the given message is forwarded to all the registered output Handler objects. Syntax: public void finest(String msg) Parameters: This method accepts a single parameter String which is the string message. Return value: This method returns nothing. Below programs illustrate finest(String msg) method: Program 1: Java // Java program to demonstrate // Logger.finest(String msg) method import java.io.IOException; import java.util.logging.*; public class GFG { public static void main(String[] args) throws SecurityException, IOException { // Create a Logger Logger logger = Logger.getLogger( GFG.class.getName()); // Create a file handler object // and set formatter to simple formatter FileHandler handler = new FileHandler("logs.txt"); handler.setFormatter(new SimpleFormatter()); // Add file handler as // handler of logs logger.addHandler(handler); // Set Logger level() logger.setLevel(Level.FINEST); // Call finest method logger.finest("Set Geeks=CODING"); } } The output printed on logs.txt file is shown below. Output: finest(Supplier msgSupplier): This method is used Log a FINEST message, constructed only if the logging level is such that the message will actually be logged. It means If the logger is enabled for the FINEST message level then the message is constructed by invoking the provided supplier function and forwarded to all the registered output Handler objects. Syntax: public void finest(Supplier msgSupplier) Parameters: This method accepts a single parameter msgSupplier which is a function, which when called, produces the desired log message. Return value: This method returns nothing. Below programs illustrate finest(Supplier msgSupplier) method: Program 1: Java // Java program to demonstrate // Logger.finest(Supplier<String>) method import java.io.IOException; import java.util.function.Supplier; import java.util.logging.*; public class GFG { public static void main(String[] args) throws SecurityException, IOException { // Create a Logger Logger logger = Logger.getLogger( GFG.class.getName()); // Create a file handler object // and set formatter to simple formatter FileHandler handler = new FileHandler("logs.txt"); handler.setFormatter(new SimpleFormatter()); // Add file handler as // handler of logs logger.addHandler(handler); // Set Logger level() logger.setLevel(Level.FINEST); // Create a supplier<String> method Supplier<String> StrSupplier = () -> new String("You are a geek"); // Call finest(Supplier<String>) logger.finest(StrSupplier); } } The output printed on log.txt is shown below. Output: References: https://docs.oracle.com/javase/10/docs/api/java/util/logging/Logger.html#finest(java.lang.String) https://docs.oracle.com/javase/10/docs/api/java/util/logging/Logger.html#finest(java.util.function.Supplier) Comment More infoAdvertise with us Next Article Logger finer() 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 fine() method in Java with Examples The fine() method of a Logger class used to Log a FINE message. This method is used to pass FINE types logs to all the registered output Handler objects. FINE, FINER and FINEST provide tracking information as when what is happening/ has happened in our application. FINE displays the most important m 3 min read Logger finer() method in Java with Examples The finer() method of a Logger class used to Log an FINER message.This method is used to pass FINER types logs to all the registered output Handler objects. FINER message: FINER outputs a detailed tracing message and may include logging calls regarding method entering, exiting, throwing exceptions. 3 min read Logger finer() method in Java with Examples The finer() method of a Logger class used to Log an FINER message.This method is used to pass FINER types logs to all the registered output Handler objects. FINER message: FINER outputs a detailed tracing message and may include logging calls regarding method entering, exiting, throwing exceptions. 3 min read Logger getFilter() Method in Java with Examples The getFilter() method of the Logger class is used to get the current filter for this Logger instance. A Filter is useful to filter out log messages. we can say that filter decide the message gets logged or not. Filters are represented by the Java interface java.util.logging.Filter Syntax: public Fi 2 min read Logger getFilter() Method in Java with Examples The getFilter() method of the Logger class is used to get the current filter for this Logger instance. A Filter is useful to filter out log messages. we can say that filter decide the message gets logged or not. Filters are represented by the Java interface java.util.logging.Filter Syntax: public Fi 2 min read Logger exiting() method in Java with Examples The exiting() method of a Logger class used to Log a method return. There are two types of exiting() method depending upon the parameters passed. exiting(String sourceClass, String sourceMethod): This method is used to Log a method return. we need to log what method returns and this is a convenience 3 min read Like