Path: csiph.com!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: Question about loggers Date: Fri, 09 Mar 2012 07:54:21 -0800 Organization: A noiseless patient Spider Lines: 23 Message-ID: References: <4f57de3b$0$286$14726298@news.sunsite.dk> <4f57fc25$0$290$14726298@news.sunsite.dk> <29668555.311.1331223311031.JavaMail.geo-discussion-forums@vbbfv2> <17863687.969.1331305893320.JavaMail.geo-discussion-forums@vblb5> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 9 Mar 2012 15:54:25 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="XjIWM99mD7Ijfdu600oVPA"; logging-data="537"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/gXrT0h6MGLUyz37aGU9pllTEdxWzRdEU=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 In-Reply-To: Cancel-Lock: sha1:d9qgLthoy6tUVt89wPR/c9TBq88= Xref: csiph.com comp.lang.java.programmer:12801 On 3/9/2012 7:45 AM, Lew wrote: > > Declaring a log member as 'static' is not more efficient. What are they > talking about? Probably the blindingly obvious point that O(1) instantiation of the logger is better than a per-object O(n) instantiation. > Robert Klemme wrote: >> http://commons.apache.org/logging/guide.html >> >> Truth is that static loggers are recommended for application code; >> only for library code they recommend against static loggers. By "application" do you mean JEE app or desktop app? Either way, I don't understand your assertion. Why would static vs. instance make any difference in a library, assuming no shared or other special classloaders are in use?