/*Program Descriptions:
This program check logger object. If given instruction is certify then shows finest message like: 'Display a finest message' otherwise no any message appear to here.
Code Descriptions:
isLoggable(Level level):
The above method is a Boolean type than returns true or false. It checks the given message is actually logged by this logger that means method is returned true.
finest(String fi_message):
The above method is used to represent the Log FINEST message. This message shows to all output handler objects when the logger is enabled at the time of finest message level . It takes string type value for message.
Here is the code of "CheckLogMessage.java":
*/
import java.io.*;
import java.util.logging.*;
public class CheckLogMessage{
public static void main(String[] args) {
Logger log = Logger.getLogger("log_file");
if(log.isLoggable(Level.OFF)){
log.finest("Display a finest message");
}
}
}
No comments:
Post a Comment