log4j is a way to assist with debugging and logging in Java applications. Simply put, it is an alternative to putting system.out.print() statements in your code, and having to take them out later—only to have to put them back in when the darn thing breaks again.
See topics/java/log4j/log4j.gettingStarted.html
I still haven't found a good basic "cookbook" like tutorial on getting started quickly. Most of these tutorials go off on complex riffs about inheritance hierarchies and levels of this and that—too much detail, too soon. If you just want to move from doing system.out.println() to something better, and do it quickly—with the idea that you'll learn all the complex, fancy stuff as and when you need it—these tutorials could be a bit frustrating.
The best one I've found so far is this one:
If you find a better tutorial, let me know. If you are a CISC474 student and you write one, that could be worth some credit towards the course—send me some email, and we'll discuss it.