Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Running the code as shown in Listing 9-1 will produce two different output streams. First, System.out (normally, the console) will produce the output as shown in Listing 9-2.
|
Code View:
Scroll
/
Show All
Added JDK 1.4 file handler
Test fatal log
Mar 22, 2004 9:04:06 PM com.cascadetg.ch09.LogGenerator main
SEVERE: null
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.<init>(Unknown Source)
at com.cascadetg.ch09.LogGenerator.main(LogGenerator.java:44)
Test error log
Mar 22, 2004 9:04:06 PM com.cascadetg.ch09.LogGenerator main
SEVERE: null
java.lang.NullPointerException
at com.cascadetg.ch09.LogGenerator.main(LogGenerator.java:56)
Test warn log
Mar 22, 2004 9:04:06 PM com.cascadetg.ch09.LogGenerator main
WARNING: Can't find a non-existant class!
Test info log
Mar 22, 2004 9:04:06 PM com.cascadetg.ch09.LogGenerator main
INFO: Starting app!
Mar 22, 2004 9:04:06 PM com.cascadetg.ch09.LogGenerator main
INFO: Quitting app!
Test debug log
Test trace log
Log test complete.
|