logger
Log API Comparison – Java Logger vs SLF4J
Log statements help record the flow of an application’s execution. Hence they are an important part of software coding process. For the Java language the common Log API libraries are Java Util Logger (commonly known as JUL), Apache Log4J, SLF4J etc. While these libraries support many advanced capabilities, most developers only use a handful of features. For example, ability to send log messages to files and the ability change log levels dynamically etc.
In this blog I will compare JUL against SLF4J and focus on these above mentioned features. Many will argue that this is not a fair comparison since SFL4J is really a facade and supports JUL as well. To clarify, I will compare the SimpleLogger that is bundled with SLF4J against direct JUL usage.
Java 7: Catching and handling multiple Exceptions
If you write networking or IO oriented programs using Java, there will be several situations where the code on the server will catch multiple exceptions. Most of the times the exceptions are logged, sometimes they are logged and re-thrown.