  | |  | Renderers and Events | Renderers and Events 2003-05-26 - By Avner BenHanoch
Back Renderer is a class that used for rendering log-object into a String. If you are not registering a Renderer than log4j will simply call the log-object's toString method. If you send a String than log4j will simply log that String.
Registering a Renderer should be used for classes that are often being logged.
If your application convert the log-object into a String and send that String to log4j debug/info/.. methods, you will have the same output. However, using Renderers enable log4j do the rendering upon need (I.e., depends on the logging level). This can save your application a lot of time in case you have many things to log.
In addition, I think, if you use AsyncAppender, the rendering will occur in the "background" instead of "delaying" your main threads for the time toString consume, which can be expensive if you log a lot of things. If this is not accurate, please correct me.
--- LogEvent is a class that wraps the log-message you send to log4j. It contain the log-message, level, date, throwable, and maybe something else.
-- -- Original Message -- -- From: "Padmaja Manike" <padmajam@(protected)> To: "Log4J Users List" <log4j-user@(protected)> Sent: Monday, May 26, 2003 4:06 PM Subject: Renderers and Events
Can anybody please explain in what context renderers and events in log4j should be used.
Regards Padmaja
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ To unsubscribe, e-mail: log4j-user-unsubscribe@(protected) For additional commands, e-mail: log4j-user-help@(protected)
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ To unsubscribe, e-mail: log4j-user-unsubscribe@(protected) For additional commands, e-mail: log4j-user-help@(protected)
Earn $52 per hosting referral at Lunarpages.
|
|
 |