Grabbing a log of the output(Runtime Exceptions)

I want to grab just a log of all runtime exceptions that happen in my program, is there any way I can do that?
[117 byte] By [ChromoXNHa] at [2007-11-27 3:31:24]
# 1
Use a try/catch statement. In the catch do your logging.
floundera at 2007-7-12 8:34:25 > top of Java-index,Java Essentials,Java Programming...
# 2
Alright but how can I catch RuntimeExceptions like NullPointerExceptions etc...
ChromoXNHa at 2007-7-12 8:34:25 > top of Java-index,Java Essentials,Java Programming...