Logger Logrb1() Example
Log a message, specifying source class, method, and resource bundle name, with a single object parameter to the log message.
Loggerclass Logrb1() method example. This example shows you how to use Logrb1() method.This method Log a message, specifying source class, method, and resource bundle name, with a single object parameter to the log message.
Here is the code:-
/*
* @Program that Log a message, specifying source class, method, and resource
bundle name, with a single object parameter to the log message.
* Logrb1.java
* Author:-RoseIndia Team
* Date:-1-July-2008
*/
import java.util.logging.Level;
import java.util.logging.Logger;
public class Logrb1 {
public static void main(String[] args) {
Logger logger = Logger.getLogger("girish.log");
Level level = Level.parse("WARNING");
String sourceClass = "Roseindia .net";
String sourceMethod = "login";
String bundleName = "ABC";
String msg = "Welcome to roseindia.net";
logger.logrb(level, sourceClass, sourceMethod, bundleName, msg,new Integer(8));
}
} |
Output of the program:-
1 Jul, 2008 5:12:26 PM Roseindia .net login
WARNING: Welcome to roseindia.net |
|