Archive for August, 2004

Logged out !

August 19, 2004

JDK 1.4 introduced logging with 1.4 of the JDK. I for my part was pathetically mired in System.out's and System.err's (hey I am still on JServ !!! yeah ol timer ;) ).

I am a eclipse user and now a "eclipse evangelist" at my company :D . So for you Eclipse users stuck on err's or out's there is a way out. There is this cool eclipse plugin log4E that takes me to the promised land !

So now that I have no excuse I have started using the 1.4 logging. We had this homegrown logging system to use in our runtime application that was really slow, so I thought let's use 1.4 logging ! Hurray I am a genius. Now that I want to do that I realize why we wrote our own logging system in the first place (duh!). The existing system has a asynchronous logging system. What this means is that the application sends the log message and continues with normal execution, now the logging system will do the expensive operation of actually writing the message to file/database etc. Now that is clever isn't it !! So folks at Sun should be atleast as smart .. right ? Noooo :( , such a thing is non-existent in the JDK! But now that I was sold on the architecture I decided to implement a Handler that does the same for 1.4 logging. So a google on the topic gave me a link to AsyncAppender in the Log4j project, now that got me "inspired" and I hacked it into a Handler. It also needed 1 other significant change too. The Appender uses a Bounded FIFO whereas I could not live with the Bound constraint. So I had to put together a Queue (I used a linked list). So now I have a decent port of the Appender to Handler :) . Now all that is left is integration and testing (why O why!). Will it make the cut ??