I love logging. In many ways it's more useful than a debugger. Long ago I wrote a simple logger, and I still use it, or nowadays Java has a built-in logger, and in my experience it's fine.
But I hate Log4J. There's one straightforward reason: by default, Log4j does nothing useful. I couldn't count the times I've seen "Please initialize the Log4J system correctly" as if it were my fault. It's a logger doesn't log!
Another reason is that to specify a daily rolling log file (which is almost always what you want) requires 5 (or more) lines of configuration.
So here's a rule for writing any software. Do the simplest useful thing by default, and make the most likely use cases as simple as possible. Log4J fails on both counts.
But I hate Log4J. There's one straightforward reason: by default, Log4j does nothing useful. I couldn't count the times I've seen "Please initialize the Log4J system correctly" as if it were my fault. It's a logger doesn't log!
Another reason is that to specify a daily rolling log file (which is almost always what you want) requires 5 (or more) lines of configuration.
So here's a rule for writing any software. Do the simplest useful thing by default, and make the most likely use cases as simple as possible. Log4J fails on both counts.
There is 1 comment on this entry.