Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!69.16.185.16.MISMATCH!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe11.iad.POSTED!8ad76e89!not-for-mail From: Arved Sandstrom User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: analysis of java application logs References: <1a96b712-59cd-4571-953b-eadaa0ec5322@r20g2000yqd.googlegroups.com> In-Reply-To: <1a96b712-59cd-4571-953b-eadaa0ec5322@r20g2000yqd.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Lines: 34 Message-ID: X-Complaints-To: abuse@newsgroups-download.com NNTP-Posting-Date: Wed, 25 May 2011 22:04:37 UTC Organization: Public Usenet Newsgroup Access Date: Wed, 25 May 2011 19:04:37 -0300 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:4582 On 11-05-25 10:00 AM, Ulrich Scholz wrote: > On 23 Mai, 23:32, Arved Sandstrom > wrote: >> >> The solution was pretty simple, and it's dynamic. [...] We had to [...] >> wrap >> log4j calls with a plethora of methods that would result in messages >> formatted to our liking, but after that the heavy lifting was and is >> done: it's now up to the clients - *not* to the developers - to request >> what gets logged and in what manner. > > Thanks for your answer. Your approach sounds reasonable. > > But what exactly do you mean with "wrap log4j calls"? > Coulnīt you just use different log4j appenders, one for each client? > The > appenders would then (i) decide whether to log a given message for a > particular > client and (ii) format it accordingly. > > Ulrich Using log4j as an example, if you look at the API for PatternLayout, you've got a bunch of conversion specifiers, including %m for the application-supplied message. The wrapping that we did, including those functional categories I mentioned, is all about formatting the application-supplied message. This included appropriate formatting of exception stack traces and so forth. We certainly also had different log4j conversion specifier combinations in use for different appenders; the "wrapping" was purely for formatting the application message, because that is opaque to log4j. AHS