Logger Finer() Example
Log a FINER message.
Loggerclass Finer() method example. This example shows you how to use Finer() method.This method Log a FINER message.
Here is the code:-
/*
* @Program that Log a FINE message.
* Finer.java
* Author:-RoseIndia Team
* Date:-1-July-2008
*/
import java.io.IOException;
import java.util.logging.ConsoleHandler;
import java.util.logging.FileHandler;
import java.util.logging.Handler;
import java.util.logging.Logger;
public class Finer {
public static void main(String args[]) {
//created logger
Logger logger = Logger.getLogger("com.example");
Logger logger1 = Logger.getLogger("com.example.words");
//declaring handler
Handler handler = null;
try {
//creating a handler
handler = new FileHandler("Rose.log");
} catch (IOException e) {
System.out.println("File not created");
handler = new ConsoleHandler();
}
//Adding a log Handler to receive logging messages.
logger.addHandler(handler);
//Log an INFO message.
logger.info("INFO Message");
//Log a FINE message.
logger.fine("fine");
//Log a FINER message.
logger.finer("finer");
}
} |
Output of the program:-
2 Jul, 2008 5:08:44 PM Finer main
INFO: INFO Message |
|