Return-Path: X-Original-To: apmail-incubator-deltaspike-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-deltaspike-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A818793FA for ; Mon, 23 Jan 2012 08:25:43 +0000 (UTC) Received: (qmail 62220 invoked by uid 500); 23 Jan 2012 08:25:43 -0000 Delivered-To: apmail-incubator-deltaspike-dev-archive@incubator.apache.org Received: (qmail 62132 invoked by uid 500); 23 Jan 2012 08:25:38 -0000 Mailing-List: contact deltaspike-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: deltaspike-dev@incubator.apache.org Delivered-To: mailing list deltaspike-dev@incubator.apache.org Received: (qmail 62116 invoked by uid 99); 23 Jan 2012 08:25:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jan 2012 08:25:35 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [217.146.183.192] (HELO nm18.bullet.mail.ukl.yahoo.com) (217.146.183.192) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 23 Jan 2012 08:25:26 +0000 Received: from [217.146.183.211] by nm18.bullet.mail.ukl.yahoo.com with NNFMP; 23 Jan 2012 08:25:06 -0000 Received: from [217.146.183.40] by tm4.bullet.mail.ukl.yahoo.com with NNFMP; 23 Jan 2012 08:25:05 -0000 Received: from [127.0.0.1] by omp1025.mail.ukl.yahoo.com with NNFMP; 23 Jan 2012 08:25:05 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 865203.12805.bm@omp1025.mail.ukl.yahoo.com Received: (qmail 45604 invoked by uid 60001); 23 Jan 2012 08:25:05 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1327307105; bh=7SMQwlmQUBDb12KRhoP412X7mxYDwPMrUO88SvL5MY8=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=FcF4skJjxOe4TG52NVPbqtBNCsi7aZrY2zaVIoq+2FNZzc6Fxysl9Mqo83KFyxXZLz75P6Lldm3/TvyrvgxIuaC1bQiexRaxCJfVZ43xxfuTTEZFHYLwfQo8MM825BOsXjlrsH1Fz6aeVai45vzLdI3liJfTIjr4w7uPch1YLPw= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.de; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=3/CcrSLa8TAsWLkGiGhXJb1CfYB7DApJqauprLBzTsRzLn5r/JCNKigMkL6wW+0XCQ7KHdPJcSaVpJu34YkvEFXFt76e7T17DOwYD1m6ob8Z8g6h34k67Ee5nl5rsI88HxaRWFZY8a8I9mrZb4Qks+E7knMFSfOQgYMYQMgZCcU=; X-YMail-OSG: bJ2b1.QVM1k7EBLQvW6vdTOiUfnjXTIuqUvx_hzYQr3xeoK zCuN6AcUL8r5pZjJqkYep2_Ac8wA9rXoRrdlNeESwdqfW9zQjf7AY9rC5eLN h22u6VTgbWwyQD5RTwRMrKczXPP6a60GUJZKUPd4eoy8wCjiiOP6dwAIkRpQ R7E96QMAsmkns2EpT066PSlbacgoQgZpvBpaEcOVQcsThqxiP4KiS4Un.YU4 Ojxxadjkq8w9.HsbXkmtvFdwfgaDeLFEht4AAl_QJ9HgsBVN3o2ZodmnxiWT XmyEd_wgW3JAlFpApjcZzT3t8RT83bWZBmKKxZaS3tk5TkpbTnIEx.hdgeWU jz069fxn0nGNQCG8u7ZyArqSb20ailTRA7GRUZWrD4TFU1Pjo5XmJ_4nNpVm c7cdMN7W0liTVbzsWn3qjSFHFr9ltBhd3WQFAFw1iy503krO09IxD Received: from [128.130.32.90] by web27802.mail.ukl.yahoo.com via HTTP; Mon, 23 Jan 2012 08:25:05 GMT X-Mailer: YahooMailWebService/0.8.115.331698 References: Message-ID: <1327307105.41793.YahooMailNeo@web27802.mail.ukl.yahoo.com> Date: Mon, 23 Jan 2012 08:25:05 +0000 (GMT) From: Mark Struberg Reply-To: Mark Struberg Subject: Re: [DISCUSS] Logging To: "deltaspike-dev@incubator.apache.org" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi!=0A=0AJust a general observation as someone who took a pretty deep look = into log4j (1 and 2) and other logger frameworks.=0A=0Ai18n logging is *pie= p* - it's really not worth it!=0A=0AWe really need to distinguish technical= logging from presenting 'messages' to the user. =0A=0ALogging should be fo= r the log only, and NEVER make it to the face of an end user. And as such, = only a technician will need to deal with it. =0A=0AI suggest to ONLY log in= english, because then it's much easier to look up the problem on the inter= net.=0A=0AImaging getting a Hungarian log message on our list. Does anybody= here know what that text would actually mean? NOPE.=0AAnd also our Hungari= an friends would also not be able to search for their problems on the inter= net, because the chance that they find the Hungarian error text is almost n= ull.=0A=0AAu contraire for always logging in English: it will be easy for u= s and easy for the guy/gal having the problem to search for a solution.=0A= =0ASo all the i18n stuff for _logging_ is really unnecessary.=0A=0AOf cours= e the idea looks generally good for our messaging module. I really liked th= e CODI messaging module which could create JSF messages on the fly. Your id= ea with the typesafe approach could fit nicely for that - and it looks easy= to provide tool support for creating the resource bundles.=0A=0AThat is al= so one thing I like to address on the long run: tool support for DeltaSpike= resource bundles. =0ACurrently pretty much every Java Resource bundle will= =0A=A0a.) pretty quickly run out of sync for the different languages (the = order must be preserved manually)=0A=A0b.) pretty quickly will contain unus= ed resource keys.=0A=0AIf we can solve this problem, I'd be more than happy= .=0A=0ABut again: this is a messaging issue and does NOT affect logging at = all!=0A=0A=0ALieGrue,=0Astrub=0A=0A=0A=0A----- Original Message -----=0A> F= rom: Ken Finnigan =0A> To: deltaspike-dev@incubator.apa= che.org=0A> Cc: =0A> Sent: Monday, January 23, 2012 4:22 AM=0A> Subject: [D= ISCUSS] Logging=0A> =0A> All,=0A> =0A> As we approach a 0.1 release of Delt= aSpike, congratulations to everyone on=0A> the good work so far, I feel it'= s a good time to begin discussing how we=0A> want to handle logging within = DeltaSpike.=A0 I certainly don't expect this=0A> discussion to result in co= de for 0.1, but the earlier we begin this=0A> discussion, then it increases= the likelihood of it being ready for 0.2=0A> =0A> Having been heavily invo= lved in the logging work for Solder, I know the=0A> pain that can be experi= enced in not getting it right, and also how long it=0A> can take to get rig= ht.=0A> =0A> I see that there are several goals that we want for logging in= DeltaSpike:=0A> =0A> =A0 1. Make it simple for both extension writers and= end users.=A0 If it's too=0A> =A0 difficult to implement, use or even get= right, then we'll frustrate and=0A> =A0 alienate developers.=0A> =A0 2. = It must perform.=A0 We don't want to introduce large overhead to=0A> =A0 l= ogging.=0A> =A0 3. There should be an option to allow/provide type safe lo= gging. [1]=0A> =A0 4. An end user should be able to have DeltaSpike log ag= ainst whichever=0A> =A0 logging library they want to utilize in their appl= ication.=A0 We can=0A> =A0 certainly support a specific framework as a def= ault, but it's important =0A> to=0A> =A0 allow a developer to have the sam= e control over how DeltaSpike is logged as=0A> =A0 their own application.= =0A> =0A> Thoughts?=0A> =0A> Regards=0A> =0A> Ken Finnigan=0A> =0A> =0A> [1= ] An example of type safe logging, from Solder, is to define an interface= =0A> such as:=0A> =0A> @MessageLogger=0A> public interface BirdLogger {=0A>= =A0 =A0 @Log=0A> =A0 =A0 @Message("Spotted %s Hawks")=0A> =A0 =A0 void log= HawksSpotted(int number);=0A> =0A> =A0 =A0 @Log=0A> =A0 =A0 @Message("Spott= ed %s Owls")=0A> =A0 =A0 void logOwlsSpotted(int number);=0A> =0A> =A0 =A0 = @Log=0A> =A0 =A0 @Message("Spotted %s Bald Eagles")=0A> =A0 =A0 void logBal= dEaglesSpotted(int number);=0A> }=0A> =0A> and then create properties files= for each language that you want to support=0A> for these log messages.=A0 = For instance, if the interface existed in the=0A> org.deltaspike.logging pa= ckage, then you would create=0A> org.deltaspike.logging.BirdLogger.i18n_fr.= properties containing names=0A> matching the methods on the above interface= , and values representing=0A> localized versions of the String within @Mess= age.=0A> =0A> Finally, a compile time annotation processor would generate c= oncrete=0A> classes for each interface and localized version.=A0 In the abo= ve example you=0A> would end up with BirdLogger.class and BirdLogger_fr.cla= ss=0A> =0A> To use the logger that was generated, you then simply do someth= ing like:=0A> =A0 =A0 @Inject=0A> =A0 =A0 private BirdLogger logger;=0A> = =0A> =A0 =A0 public void generateLogMessage() {=0A> =A0 =A0 =A0 =A0 logger.= logBaldEaglesSpotted(2);=0A> =A0 =A0 }=0A>