Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Nigel Wade Newsgroups: comp.lang.java.programmer Subject: Re: analysis of java application logs Date: Tue, 24 May 2011 12:26:39 +0100 Lines: 33 Message-ID: <941ivgF1amU1@mid.individual.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: individual.net Lq3vK0B7ci/w4O1HX5Nh8AfcYYcIcyYlsRXMLo9o1v1D6IBaUZ Cancel-Lock: sha1:pgyqZV0mKTx8WMHvdNZ4uPR/+Ms= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.1.16) Gecko/20101125 SUSE/3.0.11 Thunderbird/3.0.11 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:4523 On 23/05/11 23:25, Martin Gregorie wrote: > On Mon, 23 May 2011 15:02:23 -0400, Lew wrote: > >> On 05/23/2011 01:16 PM, Daniele Futtorovic wrote: >>> Let me emphasize: IMHO debugging logs and logs for analysis are two >>> different things and should be kept strictly separated -- possibly >>> logged to a different target respectively. >> >> That last is rather a brilliant idea, to use different targets. >> Heretofore I've espoused that logs are primarily an operations tool, not >> a debugging tool, although in service of the former they inevitably and >> inherently must support the former. The problem I've always seen is >> that logging statements are left up to the programmer, and not specified >> for the project. >> > I tend to use at least two logging streams: debugging and operational. I > leave debugging statements in production code: its normally off (of > course) but can be turned on if needed. There is one caveat to leaving debug logging in production code; it may affect performance. Even with output disabled the string arguments are still constructed, unless they are constant. If logging is located in a tight loop, or critical section, it might become significant. In one particular application I profiled I found this to be eating up 80% of the CPU time. Admittedly, this was a rather special case, but it's still something which ought to be borne in mind if you leave debug logging code in production software. -- Nigel Wade