Exception Handling with Spring and Log4J
How to log exceptions. This technique will log messages to your server log file, send an email, with the tag stack of the error, for error level warnings and display a generic page to the user.
First step is to set up Log4j.
Make sure you have the following classes in application lib or common server lib.
activation.jar
This can be got from http://java.sun.com/products/javabeans/jaf/downloads/index.html
Set up your log4J configuration file, put this file in your WEB-INF directory
Changing Log4j logging levels dynamically
Simple problem and may seem oh-not-so-cool. Make the log4j level dynamically configurable. You should be a able to change from DEBUG to INFO or any of the others. All this in a running application server.
Where possible, creating Web applications — including Ajax-based applications — in a RESTful way avoids a large class of bugs. However, a pitfall of REST (REpresentational State Transfer) is sending duplicate data across similar XMLHttpRequests. This tip shows how the moderate use of session cookies can maintain just enough server-side state to significantly reduce client-server traffic, while still allowing fallback to cookie-free operation.
Quite an old article on JavaWorld: "As part of the Java language, the java.lang package is implicitly imported into every Java program. This package's pitfalls surface often, affecting most programmers. This month, I'll discuss the traps lurking in the Runtime.exec() method."
Joel on SW article, one argument is quite useful regarding the ongoing outsourcing discussion. Anyway, the most funny thing is, that Mozart did NOT write the whole Requiem, only Inroitus and Kyrie, the rest is Eybler and Süßmayr.