Logger IsLoggable() Example

Started by VelMurugan, Dec 05, 2008, 02:00 PM

Previous topic - Next topic

VelMurugan

Logger IsLoggable() Example

returns true if the given message level is currently being logged.

Loggerclass IsLoggable() method example. This example shows you how to use IsLoggable() method.This method returns true if the given message level is currently being logged.

Here is the code:-

/*
* @Program that Returns true if the given message level is currently being logged.
* IsLoggable.java
* Author:-RoseIndia Team
* Date:-2-July-2008
*/

import java.util.logging.Level;
import java.util.logging.Logger;

public class IsLoggable {

    public static void main(String[] args) {
        Logger logger = Logger.getLogger("g.log");
        boolean b = logger.isLoggable(Level.FINER);
        System.out.println(b);

    }
}


Output of the program:-

false

Source : CodeDiary