Logger Logp2() Example

Log a message, specifying source class and method, with an array of object arguments.


Loggerclass Logp2() method example. This example shows you how to use Logp2() method.This method Log a message, specifying source class and method, with an array of object arguments.

Here is the code:-
/* 
 * @Program that Log a message, specifying source class and method, with an 
    array of object arguments.
 * Logp2.java 
 * Author:-RoseIndia Team
 * Date:-1-July-2008
 */

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

public class Logp2 {

    public static void main(String[] args) {
        Logger logger = Logger.getLogger("girish.log");
        Level level = Level.parse("WARNING");
        String Source = "Roseindia .net";
        String sourceMethod = "login";
        String msg = "Welcome to roseindia.net";
        String s[]={"r","o","h","i","n","i"};
       logger.logp(level, Source, sourceMethod, msg,s);
    }
}

Output of the program:-
 1 Jul, 2008 4:56:09 PM Roseindia .net login
WARNING: Welcome to roseindia.net

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

HOME | COPYRIGHT | CONTACT US