Return-Path: Delivered-To: apmail-jakarta-httpclient-user-archive@www.apache.org Received: (qmail 10439 invoked from network); 1 Aug 2007 17:46:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Aug 2007 17:46:11 -0000 Received: (qmail 11150 invoked by uid 500); 1 Aug 2007 17:46:10 -0000 Delivered-To: apmail-jakarta-httpclient-user-archive@jakarta.apache.org Received: (qmail 10970 invoked by uid 500); 1 Aug 2007 17:46:10 -0000 Mailing-List: contact httpclient-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: "HttpClient User Discussion" Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-user@jakarta.apache.org Received: (qmail 10958 invoked by uid 99); 1 Aug 2007 17:46:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Aug 2007 10:46:10 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_HELO_PASS,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [212.227.126.183] (HELO moutng.kundenserver.de) (212.227.126.183) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Aug 2007 17:45:42 +0000 Received: from [85.180.27.39] (helo=[85.180.27.39]) by mrelayeu.kundenserver.de (node=mrelayeu5) with ESMTP (Nemesis), id 0ML25U-1IGIGW2w0W-0004gS; Wed, 01 Aug 2007 19:45:44 +0200 Message-ID: <46B0C6CA.8070109@dubioso.net> Date: Wed, 01 Aug 2007 19:45:46 +0200 From: Roland Weber User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.5) Gecko/20070730 SeaMonkey/1.1.3 MIME-Version: 1.0 To: HttpClient User Discussion Subject: Re: Per thread logging References: <46AE5A2D.7060807@worldlingo.com> <46AF77A5.2060502@dubioso.net> <46AFB5E4.8010408@worldlingo.com> <1185969264.5549.4.camel@okhost> In-Reply-To: <1185969264.5549.4.camel@okhost> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX18yPliPpNY1LWJ/i4BVtf+97io71rOxt2GCli2 B1ol5olJOjd57/5XXIUUMaZTEaSskMrsT7lPgZduSHngdQ6tYe 3Wp4u7zAtkG21a3ZgXHyNCQlfhMqFwX X-Virus-Checked: Checked by ClamAV on apache.org Hi Oleg, > Why do not you simply use Log4J or similar logging toolkit to output the > name of the thread that generated the logging event? The environment has several hundred threads. You don't want to enable output from several hundred threads and figure out later which of these is the relevant one. The performance of the server would collapse immediately. Furthermore, the requests for a single user will be served by different threads over time. What you need for this scenario is a way to enable logging selectively, based on some attribute in the user session. This cannot be handled by simply configuring a logging toolkit. > In my opinion this kind of functionality falls into the responsibility > of the underlying logging toolkit, not HttpClient It's the responsibility of the application and the logging framework, yes. But if HttpClient can offer a simple way to achieve the result without ThreadLocal hacks, then why not? Getting a logger name from the parameters instead of using a hardcoded one in certain situations is not an unreasonable change. "Certain situations" are cases where a long-living object with a logger is created, such as an instance of the Wire class. The situation will be simplified when we get rid of static logger instances (HTTPCLIENT-668). Then, a custom log factory can supply a thread-specific logger instance. Still, getting the logger name from parameters is even simpler. Or would be, if connection pooling didn't interfere with per-thread settings. That's something to be considered for timeouts and buffer sizes, too. cheers, Roland --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: httpclient-user-help@jakarta.apache.org