On Jun 18, 2007, at 20:12 , Oliver Lietz wrote:
Hi Greg,

have you read "Should Logger members of a class be declared as static?" -
http://slf4j.org/faq.html#declared_static? Any comments?

Not before just now. I'm curious to know who "this author" is, because he's basically recalling us what a static variable is... duh. The point is: in webapps, you have a separate classloader (and that's per the spec, afaik). Log4j being loaded by the webapp and not the container (at least.. ideally...), I don't think it's a concern. Besides, I'm generally against logging and in favor of short-lived instances. I wouldn't want a fanatic logger to argue that his classes has to have a long life (i.e as a singleton when it's unnecessary) for the sake of avoiding retrieving a logger instance at every instanciation (while instanciation IS cheap per se, I'm not convinced that retrieving a logger is; that mostly depends on the underlying logging mechanism, I guess)

g



----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------

Reply via email to