Logger SetLevel() Example

Set the log level specifying which message levels will be logged by this logger.


Loggerclass SetLevel() method example. This example shows you how to use SetLevel() method.This method Set the log level specifying which message levels will be logged by this logger.

Here is the code:-
/* 
 * @Program that Set the log level specifying which message levels will be 
    logged by this logger. 
 * SetLevel.java 
 * Author:-RoseIndia Team
 * Date:-2-July-2008
 */

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

public class SetLevel {

    public static void main(String[] args) {
        Logger logger = Logger.getLogger("g.log");
        // Set the log level
        logger.setLevel(Level.INFO);
        System.out.println(logger.getLevel());
    }
}

Output of the program:-
 INFO

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US