Logger Log2() Example

Log a message, with one object parameter.


Loggerclass Log2() method example. This example shows you how to use Log2() method.This method Log a message, with one object parameter.

Here is the code:-
/* 
 * @Program that Log2 a message, with one object parameter.
 * Log2.java 
 * Author:-RoseIndia Team
 * Date:-1-July-2008
 */

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

public class Log2 {

    public static void main(String[] args) {
        Logger logger = Logger.getLogger("girish.log");
        //Log a message, with one object parameter.
        logger.log(Level.WARNING, "Rose India.net Pvt ltd."new String());
        logger.log(Level.WARNING, "Rose India.net Pvt ltd. is in rohini"new Object());
    }
}

Output of the program:-
 1 Jul, 2008 4:25:11 PM Log2 main
WARNING: Rose India.net Pvt ltd.
1 Jul, 2008 4:25:11 PM Log2 main
WARNING: Rose India.net Pvt ltd. is in rohini

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

HOME | COPYRIGHT | CONTACT US