Online
The Java 2 Platform SpecificationPeriodicals
"The Java Logging API" by Stuart Dabbs Halloway, June 2002, Vol 6 no 6, pp 32-37Books
Thinking in Java by Bruce EckelCore Java (TM) 2 Volume 1 - Fundamentals by Cay Horstmann and Gary Cornell
//new logging api in Java 1.4 import java.util.logging.*;
public class TestLogging { //set up a logger static Logger testLog = Logger.getLogger("Fluffycat.TestLog");
public static void main(String[] args) { //test a warning log testLog.warning("sample warning"); //test all priority levels to lowest //default will only show // SEVERE, WARNING, and INFO on your console testLog.log(Level.SEVERE, "severe log"); testLog.log(Level.WARNING, "warning log"); testLog.log(Level.INFO, "info log"); testLog.log(Level.CONFIG, "config log"); testLog.log(Level.FINE, "fine log"); testLog.log(Level.FINER, "finer log"); testLog.log(Level.FINEST, "finest log"); testLog.log(Level.ALL, "all log"); } }
May 14, 2002 10:33:18 AM TestLogging main WARNING: sample warning May 14, 2002 10:33:18 AM TestLogging main SEVERE: severe log May 14, 2002 10:33:18 AM TestLogging main WARNING: warning log May 14, 2002 10:33:18 AM TestLogging main INFO: info log
| Sign In |
| to add the first comment for Java Logging. |