Sunday, November 20th, 2005
We recently mentioned a log4js logging toolkit on the site.
There is another version of this at log4js.sourceforge.net.
The Ajaxian team has seen this kind of thing before, on the Java side.
For those that don’t know, a bunch of logging frameworks came up in Java, to give you more than just
We had LogKit, and then the big daddy, Log4J.
Sun and the JCP came around and tried to create a “standard” logging framework,
java.logging.*, but by then it was too late.
With all of these options, you ended up with some components using one logging framework, and others using another.
So, what could we do?
They came up with Commons Logging, a meta framework that allowed you to write to one API, and plugin the particular logging engine separately.
This logging toolkit abstracts away the various logging frameworks so you never need to learn them, you can just learn out framework.
Dynamic Discovery of Logging Framework
The coolest feature of Ajaxian Commons Abstract Logging is how dynamic discovery works.
We quickly realised that having to download the logging files again and again was bad for performance, so we use XUL on Mozilla, and HTA on IE to use file storage. We then keep just ONE copy of each logging framework that you have used, and discover one instantly when things start up.
When you use XUL/HTA for these file system access the user gets asked for permission to access disk, but we figure that inconvenience is minor compared to the performance increase in keeping one framework.js file around. I think you would agree.
We are now considering where to donate this code. Maybe Mozilla? Maybe Dojo?
Posted by Dion Almaer at 8:33 pm