Logger Logrb3() Example
Log a message, specifying source class, method, and resource bundle name, with associated Throwable information.
Loggerclass Logrb3() method example. This example shows you how to use Logrb3() method.This method Log a message, specifying source class, method, and resource bundle name, with associated Throwable information.
Here is the code:-
/*
* @Program that Log a message, specifying source class, method, and resource
bundle name, with associated Throwable information.
* Logrb3.java
* Author:-RoseIndia Team
* Date:-1-July-2008
*/
import java.util.logging.Level;
import java.util.logging.Logger;
public class Logrb3 {
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";
Throwable t = new Throwable("File not found");
logger.logrb(level, sourceClass, sourceMethod, bundleName, msg, t);
}
} |
Output of the program:-
2 Jul, 2008 12:45:42 PM Roseindia .net login
WARNING: Welcome to roseindia.net
java.lang.Throwable: File not found |
|