Howdy, >I'm wondering whether there are any useful object renderers that I haven't >heard about, hopefully downloadable and easily integratable. Things I'd be >looking to output without having to have long debugging logic in my code >would be beans, JDBC ResultSet rows, and so on. Looking around the log4j >codebase all I can see is one jms and one sax renderers, both rather basic.
I'm sure people have done these for their own projects: they're not tough. They would be a nice contribution to the log4j sandbox for starters, maybe to be integrated into the core later on. >It seems to me that this would be a very useful feature, improving the I prefer toString() methods that print all the information about the Object. Then I just call logger.debug(myObject) (which calls myObject.toString() down the line automatically) without writing or configuring any ObjectRenderers. But that's just me. However, there's the case where the object you want to log is not yours, e.g. java.sql.ResultSet, and if it doesn't have a good toString() method an ObjectRenderer would be perfect. >In any case, I think the inclusion of more useful standard Object Renderers >into the log4j codebase would be a very good thing for log4j, and I'm >wondering why this hasn't been done yet. Are there any reasons that I'm not >aware of? The usual reason: no one cares enough to contribute it? ;) I'm sure many have written their own. An ObjectRenderer to display your two cases: a Bean and a java.sql.ResultSet, wouldn't be that hard. They might have a couple of catches: the bean one would use reflection and probably wouldn't display information that can't be obtained via public methods (often one also wants private/protected field values displayed). The ResultSet one would have to be careful about resetting the ResultSet to its original condition when it's done rendering. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
