From bugzilla-daemon at pixie.qos.ch Sun Aug 9 19:51:31 2009 From: bugzilla-daemon at pixie.qos.ch (bugzilla-daemon at pixie.qos.ch) Date: Sun, 9 Aug 2009 19:51:31 +0200 (CEST) Subject: [slf4j-dev] [Bug 144] New: Logger Interface Should (Arguably) Extend Serializable Message-ID: http://bugzilla.slf4j.org/show_bug.cgi?id=144 Summary: Logger Interface Should (Arguably) Extend Serializable Product: SLF4J Version: 1.5.x Platform: PC OS/Version: Windows XP Status: NEW Severity: minor Priority: P3 Component: Core API AssignedTo: dev at slf4j.org ReportedBy: djgredler at gmail.com The fix to bug 71 made all Logger implementations serializable; however, it is not *guaranteed* that Logger instances are serializable because Logger does not extend the Serializable interface. This may not be doable due to backwards-compatibility concerns, but ideally Logger would extend Serializable, guaranteeing that all Logger implementations can be serialized. -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. From ceki at slf4j.org Mon Aug 10 17:41:55 2009 From: ceki at slf4j.org (ceki at slf4j.org) Date: Mon, 10 Aug 2009 17:41:55 +0200 (CEST) Subject: [slf4j-dev] svn commit: r1382 - slf4j/trunk/slf4j-site/src/site/pages Message-ID: <20090810154155.6A1782C5F30@pixie.qos.ch> Author: ceki Date: Mon Aug 10 17:41:55 2009 New Revision: 1382 Modified: slf4j/trunk/slf4j-site/src/site/pages/docs.html Log: - link to Jazoon 2009 presentation with audio Modified: slf4j/trunk/slf4j-site/src/site/pages/docs.html ============================================================================== --- slf4j/trunk/slf4j-site/src/site/pages/docs.html (original) +++ slf4j/trunk/slf4j-site/src/site/pages/docs.html Mon Aug 10 17:41:55 2009 @@ -50,6 +50,11 @@ SLF4J in 10 slides, by Ceki Gülcü +
  • SLF4J + and Logback projects, by C. Gülcü and S. Pennec + (Jazoon presentation with audio). +
  • From bugzilla-daemon at pixie.qos.ch Tue Aug 11 12:07:55 2009 From: bugzilla-daemon at pixie.qos.ch (bugzilla-daemon at pixie.qos.ch) Date: Tue, 11 Aug 2009 12:07:55 +0200 (CEST) Subject: [slf4j-dev] [Bug 144] Logger Interface Should (Arguably) Extend Serializable In-Reply-To: Message-ID: <20090811100755.67D2C1BE5BC@pixie.qos.ch> http://bugzilla.slf4j.org/show_bug.cgi?id=144 Marc Guillemot changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mguillemot at yahoo.fr -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. From pmuir at redhat.com Mon Aug 17 19:05:26 2009 From: pmuir at redhat.com (Pete Muir) Date: Mon, 17 Aug 2009 18:05:26 +0100 Subject: [slf4j-dev] slf4j i8ln Message-ID: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> Hi, As discussed here https://jira.jboss.org/jira/browse/WBRI-290, we would like to switch to slf4j as our logger (it offers a logging facade, supports MDC/NDC and parameter replacement). However, as Takeshi highlights here https://jira.jboss.org/jira/browse/WBRI-214 , a needed feature is explicit i8n support, and it sounds like Ceki would be happy to accept a contribution for this directly to the slf4j. Perhaps, to get started, we should discuss the overall design and aims. In the linked issue, Takeshi adds three features in the patch: - ability to localize a message by providing a resource bundle, which has the same name as the class using the logger (the declaring class) - the ability to log an enum value (rather than using a static to hold the message/key) - the ability to associate the level at which to log with the message with the enum (via an annotation) rather than in the call from the declaring class (Takeshi, correct me if this is incorrect). I think we can probably separate these features out when discussing. I think we would also need: - ability to specify the resource bundle to use when getting the logger - ability to use statics fields or just a string id embedded in call to logger But I'm sure others have given this more thought than me! Pete From rgoers at apache.org Mon Aug 17 23:41:12 2009 From: rgoers at apache.org (Ralph Goers) Date: Mon, 17 Aug 2009 14:41:12 -0700 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> Message-ID: <014D9CDA-A9A4-4B50-A5DA-E8609EA17C9E@apache.org> My 2 cents. ResourceBundles suck. Even in Java 1.6 it is difficult to change the implementation and it only works if the application cooperates. The default implementation finds the bundles in the classpath which makes it difficult if you like to store the files outside of the application. Also, since they are loaded on the classpath they aren't automatically reloaded when modified. My organization also has "special" needs when it comes to internationalization - a single application can support thousands of clients each of which may want to override some of the keys in the bundles. In short, it seems to me to make far more sense to use a separate I18n framework to deal with the actual message text and then just make sure that SLF4J can accept the Locale as a parameter to be passed to the Appender. Another option along the same lines would be to use the message field as the message key, along with the parameters and pass those to the Appender along with the locale. There again, an I18N framework would deal with the messages. In short, SLF4J should support I18N but not implement it. FWIW - I have a need to implement an I18N framework based on Apache Commons Configuration to support the needs I discussed in the first paragraph. I'm considering doing it in the existing I18N project in the Apache Commons Sandbox. Ralph On Aug 17, 2009, at 10:05 AM, Pete Muir wrote: > Hi, > > As discussed here https://jira.jboss.org/jira/browse/WBRI-290, we > would like to switch to slf4j as our logger (it offers a logging > facade, supports MDC/NDC and parameter replacement). > > However, as Takeshi highlights here https://jira.jboss.org/jira/browse/WBRI-214 > , a needed feature is explicit i8n support, and it sounds like Ceki > would be happy to accept a contribution for this directly to the > slf4j. > > Perhaps, to get started, we should discuss the overall design and > aims. In the linked issue, Takeshi adds three features in the patch: > > - ability to localize a message by providing a resource bundle, > which has the same name as the class using the logger (the declaring > class) > - the ability to log an enum value (rather than using a static to > hold the message/key) > - the ability to associate the level at which to log with the > message with the enum (via an annotation) rather than in the call > from the declaring class > > (Takeshi, correct me if this is incorrect). I think we can probably > separate these features out when discussing. > > I think we would also need: > > - ability to specify the resource bundle to use when getting the > logger > - ability to use statics fields or just a string id embedded in call > to logger > > But I'm sure others have given this more thought than me! > > Pete > _______________________________________________ > dev mailing list > dev at slf4j.org > http://www.slf4j.org/mailman/listinfo/dev From pmuir at redhat.com Tue Aug 18 15:38:07 2009 From: pmuir at redhat.com (Pete Muir) Date: Tue, 18 Aug 2009 14:38:07 +0100 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> Message-ID: <029C9E64-6C1B-447B-9D3B-58202A0AC077@redhat.com> To follow up on this, Mark Little pointed me at the Common Logging Framework developed by Arjuna as another way this problem has been addressed in the past. See http://docs.jboss.org/process-guide/en/html/internationalization.html#d0e4183 On 17 Aug 2009, at 18:05, Pete Muir wrote: > Hi, > > As discussed here https://jira.jboss.org/jira/browse/WBRI-290, we > would like to switch to slf4j as our logger (it offers a logging > facade, supports MDC/NDC and parameter replacement). > > However, as Takeshi highlights here https://jira.jboss.org/jira/browse/WBRI-214 > , a needed feature is explicit i8n support, and it sounds like Ceki > would be happy to accept a contribution for this directly to the > slf4j. > > Perhaps, to get started, we should discuss the overall design and > aims. In the linked issue, Takeshi adds three features in the patch: > > - ability to localize a message by providing a resource bundle, > which has the same name as the class using the logger (the declaring > class) > - the ability to log an enum value (rather than using a static to > hold the message/key) > - the ability to associate the level at which to log with the > message with the enum (via an annotation) rather than in the call > from the declaring class > > (Takeshi, correct me if this is incorrect). I think we can probably > separate these features out when discussing. > > I think we would also need: > > - ability to specify the resource bundle to use when getting the > logger > - ability to use statics fields or just a string id embedded in call > to logger > > But I'm sure others have given this more thought than me! > > Pete > _______________________________________________ > dev mailing list > dev at slf4j.org > http://www.slf4j.org/mailman/listinfo/dev From rgoers at apache.org Tue Aug 18 16:11:00 2009 From: rgoers at apache.org (Ralph Goers) Date: Tue, 18 Aug 2009 07:11:00 -0700 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <029C9E64-6C1B-447B-9D3B-58202A0AC077@redhat.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <029C9E64-6C1B-447B-9D3B-58202A0AC077@redhat.com> Message-ID: <147F5E44-AA6E-4052-B216-07C5093E2BE2@apache.org> Interesting, but I personally would not be happy with that interface. 1. It relies on resource bundles. 2. None of the methods accept a Locale so the framework has to rely on the default locale. Without this it means that while the app can support any language a particular instance can only support one. That is fine in some use cases but not all. I actually dealt with this kind of stuff years ago. Consider a use case where you have call centers in Japan, France and the U.S. each handling customers in their native country and the application is running in a single data center. a) either all your customer service reps have to understand a single language or b) the log records need to be written to a file using the message key and the substitution parameters. The message should not be localized until it is going to appear on the customer service reps console so they can read it in whatever language they are configured for. To truly internationalize properly the translation needs to happen as late as possible. In that case the logging framework doesn't even really need to support resource bundles. But, assuming you still want to have the framework "do" I18N, as I said in my earlier message, it can still be handled in the appender, not in the API layer. Ralph On Aug 18, 2009, at 6:38 AM, Pete Muir wrote: > To follow up on this, Mark Little pointed me at the Common Logging > Framework developed by Arjuna as another way this problem has been > addressed in the past. > > See http://docs.jboss.org/process-guide/en/html/internationalization.html#d0e4183 > > On 17 Aug 2009, at 18:05, Pete Muir wrote: > >> Hi, >> >> As discussed here https://jira.jboss.org/jira/browse/WBRI-290, we >> would like to switch to slf4j as our logger (it offers a logging >> facade, supports MDC/NDC and parameter replacement). >> >> However, as Takeshi highlights here https://jira.jboss.org/jira/browse/WBRI-214 >> , a needed feature is explicit i8n support, and it sounds like Ceki >> would be happy to accept a contribution for this directly to the >> slf4j. >> >> Perhaps, to get started, we should discuss the overall design and >> aims. In the linked issue, Takeshi adds three features in the patch: >> >> - ability to localize a message by providing a resource bundle, >> which has the same name as the class using the logger (the >> declaring class) >> - the ability to log an enum value (rather than using a static to >> hold the message/key) >> - the ability to associate the level at which to log with the >> message with the enum (via an annotation) rather than in the call >> from the declaring class >> >> (Takeshi, correct me if this is incorrect). I think we can probably >> separate these features out when discussing. >> >> I think we would also need: >> >> - ability to specify the resource bundle to use when getting the >> logger >> - ability to use statics fields or just a string id embedded in >> call to logger >> >> But I'm sure others have given this more thought than me! >> >> Pete >> _______________________________________________ >> dev mailing list >> dev at slf4j.org >> http://www.slf4j.org/mailman/listinfo/dev > > _______________________________________________ > dev mailing list > dev at slf4j.org > http://www.slf4j.org/mailman/listinfo/dev From takeshi.kondo at gmail.com Tue Aug 18 18:59:41 2009 From: takeshi.kondo at gmail.com (=?ISO-2022-JP?B?GyRCNmFGIxsoQiAbJEI3chsoQg==?=) Date: Wed, 19 Aug 2009 01:59:41 +0900 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <029C9E64-6C1B-447B-9D3B-58202A0AC077@redhat.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <029C9E64-6C1B-447B-9D3B-58202A0AC077@redhat.com> Message-ID: <732765AB-0D3D-445B-AE7B-7003664B93BC@gmail.com> Hi I think i8n is important feature, but separating message and level in the call from declaring class lead other feature. * about message My customer almost claim documentation of log message list. so I've developed documentation tool to convert to MS Excel from log message enum. this development is easy if log message is collected. * about log level Around me, error level log is trigger to inform system problem to person in charge. if error log is out, person in charge is called even if it is the middle of the night. so I frequently change log level to adapt operation environment. log level hard coding afflict me. Takeshi On 2009/08/18, at 22:38, Pete Muir wrote: > To follow up on this, Mark Little pointed me at the Common Logging > Framework developed by Arjuna as another way this problem has been > addressed in the past. > > See http://docs.jboss.org/process-guide/en/html/internationalization.html#d0e4183 > > On 17 Aug 2009, at 18:05, Pete Muir wrote: > >> Hi, >> >> As discussed here https://jira.jboss.org/jira/browse/WBRI-290, we >> would like to switch to slf4j as our logger (it offers a logging >> facade, supports MDC/NDC and parameter replacement). >> >> However, as Takeshi highlights here https://jira.jboss.org/jira/browse/WBRI-214 >> , a needed feature is explicit i8n support, and it sounds like Ceki >> would be happy to accept a contribution for this directly to the >> slf4j. >> >> Perhaps, to get started, we should discuss the overall design and >> aims. In the linked issue, Takeshi adds three features in the patch: >> >> - ability to localize a message by providing a resource bundle, >> which has the same name as the class using the logger (the >> declaring class) >> - the ability to log an enum value (rather than using a static to >> hold the message/key) >> - the ability to associate the level at which to log with the >> message with the enum (via an annotation) rather than in the call >> from the declaring class >> >> (Takeshi, correct me if this is incorrect). I think we can probably >> separate these features out when discussing. >> >> I think we would also need: >> >> - ability to specify the resource bundle to use when getting the >> logger >> - ability to use statics fields or just a string id embedded in >> call to logger >> >> But I'm sure others have given this more thought than me! >> >> Pete >> _______________________________________________ >> dev mailing list >> dev at slf4j.org >> http://www.slf4j.org/mailman/listinfo/dev > From bugzilla-daemon at pixie.qos.ch Tue Aug 18 22:20:21 2009 From: bugzilla-daemon at pixie.qos.ch (bugzilla-daemon at pixie.qos.ch) Date: Tue, 18 Aug 2009 22:20:21 +0200 (CEST) Subject: [slf4j-dev] [Bug 31] Varargs for Logger methods In-Reply-To: Message-ID: <20090818202021.E3BEA2E167E@pixie.qos.ch> http://bugzilla.slf4j.org/show_bug.cgi?id=31 David Rosenstrauch changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |darose at darose.net --- Comment #34 from David Rosenstrauch 2009-08-18 22:20:21 --- I take it that this is still an unresolved issue? Has everyone just hit an impasse on trying to find a workable solution? -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. From bugzilla-daemon at pixie.qos.ch Wed Aug 19 10:45:42 2009 From: bugzilla-daemon at pixie.qos.ch (bugzilla-daemon at pixie.qos.ch) Date: Wed, 19 Aug 2009 10:45:42 +0200 (CEST) Subject: [slf4j-dev] [Bug 31] Varargs for Logger methods In-Reply-To: Message-ID: <20090819084542.0D3162E2E48@pixie.qos.ch> http://bugzilla.slf4j.org/show_bug.cgi?id=31 Ceki Gulcu changed: What |Removed |Added ---------------------------------------------------------------------------- CC|listid at qos.ch | -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. From bugzilla-daemon at pixie.qos.ch Wed Aug 19 11:24:23 2009 From: bugzilla-daemon at pixie.qos.ch (bugzilla-daemon at pixie.qos.ch) Date: Wed, 19 Aug 2009 11:24:23 +0200 (CEST) Subject: [slf4j-dev] [Bug 145] New: Typos in http://slf4j.org/legacy.html Message-ID: http://bugzilla.slf4j.org/show_bug.cgi?id=145 Summary: Typos in http://slf4j.org/legacy.html Product: SLF4J Version: 1.5.x Platform: PC OS/Version: Windows XP Status: NEW Severity: minor Priority: P1 Component: Unspecified AssignedTo: dev at slf4j.org ReportedBy: listid at qos.ch Typos in http://slf4j.org/legacy.html -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. From bugzilla-daemon at pixie.qos.ch Wed Aug 19 11:26:21 2009 From: bugzilla-daemon at pixie.qos.ch (bugzilla-daemon at pixie.qos.ch) Date: Wed, 19 Aug 2009 11:26:21 +0200 (CEST) Subject: [slf4j-dev] [Bug 145] Typos in http://slf4j.org/legacy.html In-Reply-To: Message-ID: <20090819092621.868EB2E3E77@pixie.qos.ch> http://bugzilla.slf4j.org/show_bug.cgi?id=145 --- Comment #1 from Ceki Gulcu 2009-08-19 11:26:21 --- If both are present *simulatenously* , slf4j calls will be delegated to log4j, and log4j calls redirected to SLF4j, resulting in an endless recursion. simulatenously is a typo -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. From pmuir at redhat.com Wed Aug 19 17:31:23 2009 From: pmuir at redhat.com (Pete Muir) Date: Wed, 19 Aug 2009 16:31:23 +0100 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <014D9CDA-A9A4-4B50-A5DA-E8609EA17C9E@apache.org> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <014D9CDA-A9A4-4B50-A5DA-E8609EA17C9E@apache.org> Message-ID: <0A56E606-E28B-4850-988B-3DFD0E2A91A0@redhat.com> Hi Ralph, Whether or not resource bundles suck in our opinion, they are the standard approach to this so I believe we can't just dismiss them. I'm also unsure how, in your approach, a framework would provide i8ln'ized log messages which would be used? On 17 Aug 2009, at 22:41, Ralph Goers wrote: > My 2 cents. > > ResourceBundles suck. Even in Java 1.6 it is difficult to change the > implementation and it only works if the application cooperates. The > default implementation finds the bundles in the classpath which > makes it difficult if you like to store the files outside of the > application. Also, since they are loaded on the classpath they > aren't automatically reloaded when modified. My organization also > has "special" needs when it comes to internationalization - a single > application can support thousands of clients each of which may want > to override some of the keys in the bundles. > > In short, it seems to me to make far more sense to use a separate > I18n framework to deal with the actual message text and then just > make sure that SLF4J can accept the Locale as a parameter to be > passed to the Appender. > > Another option along the same lines would be to use the message > field as the message key, along with the parameters and pass those > to the Appender along with the locale. There again, an I18N > framework would deal with the messages. > > In short, SLF4J should support I18N but not implement it. > > FWIW - I have a need to implement an I18N framework based on Apache > Commons Configuration to support the needs I discussed in the first > paragraph. I'm considering doing it in the existing I18N project in > the Apache Commons Sandbox. > > Ralph > > On Aug 17, 2009, at 10:05 AM, Pete Muir wrote: > >> Hi, >> >> As discussed here https://jira.jboss.org/jira/browse/WBRI-290, we >> would like to switch to slf4j as our logger (it offers a logging >> facade, supports MDC/NDC and parameter replacement). >> >> However, as Takeshi highlights here https://jira.jboss.org/jira/browse/WBRI-214 >> , a needed feature is explicit i8n support, and it sounds like Ceki >> would be happy to accept a contribution for this directly to the >> slf4j. >> >> Perhaps, to get started, we should discuss the overall design and >> aims. In the linked issue, Takeshi adds three features in the patch: >> >> - ability to localize a message by providing a resource bundle, >> which has the same name as the class using the logger (the >> declaring class) >> - the ability to log an enum value (rather than using a static to >> hold the message/key) >> - the ability to associate the level at which to log with the >> message with the enum (via an annotation) rather than in the call >> from the declaring class >> >> (Takeshi, correct me if this is incorrect). I think we can probably >> separate these features out when discussing. >> >> I think we would also need: >> >> - ability to specify the resource bundle to use when getting the >> logger >> - ability to use statics fields or just a string id embedded in >> call to logger >> >> But I'm sure others have given this more thought than me! >> >> Pete >> _______________________________________________ >> dev mailing list >> dev at slf4j.org >> http://www.slf4j.org/mailman/listinfo/dev > > _______________________________________________ > dev mailing list > dev at slf4j.org > http://www.slf4j.org/mailman/listinfo/dev From rgoers at apache.org Wed Aug 19 18:16:03 2009 From: rgoers at apache.org (Ralph Goers) Date: Wed, 19 Aug 2009 09:16:03 -0700 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <0A56E606-E28B-4850-988B-3DFD0E2A91A0@redhat.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <014D9CDA-A9A4-4B50-A5DA-E8609EA17C9E@apache.org> <0A56E606-E28B-4850-988B-3DFD0E2A91A0@redhat.com> Message-ID: On Aug 19, 2009, at 8:31 AM, Pete Muir wrote: > Hi Ralph, > > Whether or not resource bundles suck in our opinion, they are the > standard approach to this so I believe we can't just dismiss them. Let me rephrase. It isn't just that they suck. In my environment resource bundles don't work for I18N. I'm not in favor of having features implemented that I can't use. But my opinion doesn't really carry any more weight than yours. > > I'm also unsure how, in your approach, a framework would provide > i8ln'ized log messages which would be used? As I've said, I'm not at all in favor of SLF4J "doing" I18N. It is better to do it under a framework such as Spring's MessageSource interface where you can either use the default implementation, which uses ResourceBundles, or easily provide your own. As I said, I'm also planning on creating a framework to manage internationalized messages using Commons Configuration and XML files. In that scenario the application either calls getMessage() and then passes the resulting String to the log call or the application passes the message key as the message on the log call, which is the approach I would suggest. In the second scenario it is up to the Appender to resolve the key by calling getMessage(). Ideally, the Appender should be able to tell whether it is getting a key or the actual message text. This can be done simply by convention - i.e. a log message like "key=Message1" or by passing a parameter. There is no real need to enhance SLF4J to be able to do this. The piece that SLF4J is missing is the ability to detect the target Locale of the message. But even this can be handled without change to SLF4J. Just adding the Locale to the MDC would allow the Appender to do the right thing. Of course, you'd have to use a logging implementation that supports the MDC. In short, instead of asking for a change to SLF4J it would make more sense to me for you to ask for an enhancement to Logback so that any Appender can have the opportunity to internationalize the message. Currently you'd have to do that in a Layout, but I don't believe all Appenders support them. Ralph From ceki at qos.ch Wed Aug 19 20:18:17 2009 From: ceki at qos.ch (Ceki Gulcu) Date: Wed, 19 Aug 2009 20:18:17 +0200 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> Message-ID: <4A8C41E9.6030908@qos.ch> Comments inline. Pete Muir wrote: > Hi, > > As discussed here https://jira.jboss.org/jira/browse/WBRI-290, we would > like to switch to slf4j as our logger (it offers a logging facade, > supports MDC/NDC and parameter replacement). > > However, as Takeshi highlights here > https://jira.jboss.org/jira/browse/WBRI-214, a needed feature is > explicit i8n support, and it sounds like Ceki would be happy to accept a > contribution for this directly to the slf4j. Indeed. Assuming we can design a useful i18n extension to sfl4j, I would like it to ship within the slf4j distribution. > Perhaps, to get started, we should discuss the overall design and aims. > In the linked issue, Takeshi adds three features in the patch: > > - ability to localize a message by providing a resource bundle, which > has the same name as the class using the logger (the declaring class) Using resource bundles for localization make sense. I am unsure whether the resource bundle should be related to a logger's name but we can come back to this later. > - the ability to log an enum value (rather than using a static to hold > the message/key) Using emums? Interesting. How could enums be used instead of String as enum is not a specific type in itself (in the same way as class is not a type in itself). What do you mean by static? Perhaps you meant to say String instead of static? > - the ability to associate the level at which to log with the message > with the enum (via an annotation) rather than in the call from the > declaring class Takeshi mentioned that his requirement was to be able to change the level of a logging statement without needing to recompile his application. I don't see how annotations help in this case since they also need to be recompiled. Markers allow for a cleaner way of filtering out messages. Changing the level is unnecessary. For example, if all logging events of level ERROR trigger an alarm, and if a certain ERROR event should not trigger an alarm, you can mark that particular event with the "NO_ALARM" marker. Instead of debating the requirements, how about code that embodies your vision of the API (assuming everything was possible)? For example, here is a vision of the i18n API: LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); lc.addResourceBundle( aResourceBundle); Logger loggerA = LoggerFactory.getLogger("A"); Logger loggerB = LoggerFactory.getLogger("B"); // replace key_0 with its corresponding value in aResourceBundle loggerA.info("key_0"); // same as before, but also insert the value of "param" as specified in // the message loggerB.info("key_1", param); The above is just an *example* of what I mean by "vision" of the API. You can go a step further an implement something. You may wish to fork SLF4J on git. The url is http://github.com/ceki/slf4j/tree/master > (Takeshi, correct me if this is incorrect). I think we can probably > separate these features out when discussing. > > I think we would also need: > > - ability to specify the resource bundle to use when getting the logger > - ability to use statics fields or just a string id embedded in call to > logger Static field of type String? If the field is of type String, it does not matter whether the variable is an instance variable of a static one. (In a nutshell, I don't get it.) By the way, for quicker response time, you can reach me on irc: irc.freenode.net #slf4j Cheers, -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch From pmuir at redhat.com Wed Aug 19 20:21:12 2009 From: pmuir at redhat.com (Pete Muir) Date: Wed, 19 Aug 2009 19:21:12 +0100 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <014D9CDA-A9A4-4B50-A5DA-E8609EA17C9E@apache.org> <0A56E606-E28B-4850-988B-3DFD0E2A91A0@redhat.com> Message-ID: I think we are making progress here, and actually there isn't too much work to do. Let me paraphrase to make sure I am understanding you correctly. * The source of messages should be abstracted behind an interface. A default implementation that uses resource bundles could be provided for easy ootb experience. * The provision of the Locale should be an orthogonal concept to the logging of messages and the creation of the Logger. This should be handled via the MDC. IMO there are still a few questions to answer: * Takeshi original design allowed you to use Enums as keys for messages. I'm personally not sure about this, I'm not really sure what benefits it offers over Strings as keys * How does a framework provide translated messages [1] to i8ln layer? Can we also use the MDC here to push them in, and have the appender read them? * Should there be a convention for the key used? For example a key should use a FQN. * How does the integrate with the various slf4j back ends? Do we somehow want to map it to the JDK logging i8ln support? What about log4j? [1] I'm assuming that a framework developer will want to provide translations for it's logging messages Regarding your suggestion to enhance logback - I want to be able to provide l10n for my log messages regardless of which logging back end is in use (for example, the framework I am currently working on currently targets JBoss AS, GlassFish, and Tomcat as possible runtimes, which use a combination of JDK logging and log4j). On 19 Aug 2009, at 17:16, Ralph Goers wrote: > > On Aug 19, 2009, at 8:31 AM, Pete Muir wrote: > >> Hi Ralph, >> >> Whether or not resource bundles suck in our opinion, they are the >> standard approach to this so I believe we can't just dismiss them. > > Let me rephrase. It isn't just that they suck. In my environment > resource bundles don't work for I18N. I'm not in favor of having > features implemented that I can't use. But my opinion doesn't really > carry any more weight than yours. > >> >> I'm also unsure how, in your approach, a framework would provide >> i8ln'ized log messages which would be used? > > As I've said, I'm not at all in favor of SLF4J "doing" I18N. It is > better to do it under a framework such as Spring's MessageSource > interface where you can either use the default implementation, which > uses ResourceBundles, or easily provide your own. As I said, I'm > also planning on creating a framework to manage internationalized > messages using Commons Configuration and XML files. > > In that scenario the application either calls getMessage() and then > passes the resulting String to the log call or the application > passes the message key as the message on the log call, which is the > approach I would suggest. In the second scenario it is up to the > Appender to resolve the key by calling getMessage(). Ideally, the > Appender should be able to tell whether it is getting a key or the > actual message text. This can be done simply by convention - i.e. a > log message like "key=Message1" or by passing a parameter. There is > no real need to enhance SLF4J to be able to do this. > > The piece that SLF4J is missing is the ability to detect the target > Locale of the message. But even this can be handled without change > to SLF4J. Just adding the Locale to the MDC would allow the Appender > to do the right thing. Of course, you'd have to use a logging > implementation that supports the MDC. > > In short, instead of asking for a change to SLF4J it would make more > sense to me for you to ask for an enhancement to Logback so that any > Appender can have the opportunity to internationalize the message. > Currently you'd have to do that in a Layout, but I don't believe all > Appenders support them. > > Ralph > > _______________________________________________ > dev mailing list > dev at slf4j.org > http://www.slf4j.org/mailman/listinfo/dev From pmuir at redhat.com Wed Aug 19 20:29:38 2009 From: pmuir at redhat.com (Pete Muir) Date: Wed, 19 Aug 2009 19:29:38 +0100 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <4A8C41E9.6030908@qos.ch> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> Message-ID: <32FA3750-AB59-4945-A758-EE3AFA381E75@redhat.com> On 19 Aug 2009, at 19:18, Ceki Gulcu wrote: > Comments inline. > > Pete Muir wrote: >> Hi, >> As discussed here https://jira.jboss.org/jira/browse/WBRI-290, we >> would like to switch to slf4j as our logger (it offers a logging >> facade, supports MDC/NDC and parameter replacement). >> However, as Takeshi highlights here https://jira.jboss.org/jira/browse/WBRI-214 >> , a needed feature is explicit i8n support, and it sounds like Ceki >> would be happy to accept a contribution for this directly to the >> slf4j. > > Indeed. Assuming we can design a useful i18n extension to sfl4j, I > would like it to ship within the slf4j distribution. > >> Perhaps, to get started, we should discuss the overall design and >> aims. In the linked issue, Takeshi adds three features in the patch: >> - ability to localize a message by providing a resource bundle, >> which has the same name as the class using the logger (the >> declaring class) > > Using resource bundles for localization make sense. I like Ralphs suggestion of abstracting this behind a interface and providing a default impl based on ResourceBundle. > I am unsure whether the resource bundle should be related to a > logger's name but we can come back to this later. > >> - the ability to log an enum value (rather than using a static to >> hold the message/key) > > Using emums? Interesting. How could enums be used instead of String > as enum is not a specific type in itself (in the same way as class > is not a type in itself). > Sorry, I was being loose with my language. I meant using an enumerated type such as enum LogMessages { WRONG_PASSWORD, RIGHT_PASSWORD } log.warn(WRONG_PASSWORD); > What do you mean by static? Perhaps you meant to say String instead > of static? I meant a static String like class LogMessages { public static final String WRONG_PASSWORD = "com.acme.WrongPassword"; } > >> - the ability to associate the level at which to log with the >> message with the enum (via an annotation) rather than in the call >> from the declaring class > > Takeshi mentioned that his requirement was to be able to change the > level of a logging statement without needing to recompile his > application. I don't see how annotations help in this case since > they also need to be recompiled. > > Markers allow for a cleaner way of filtering out messages. Changing > the level is unnecessary. For example, if all logging events of > level ERROR trigger an alarm, and if a certain ERROR event should > not trigger an alarm, you can mark that particular event with the > "NO_ALARM" marker. Yes, I'm also not sure that this is necessary, and it's certainly another concern not really relating to i8n IMO. > > Instead of debating the requirements, how about code that embodies > your vision of the API (assuming everything was possible)? Hehe, sure, I definitely like to understand the requirements properly first, but I know others prefer a hack first approach :-) > > For example, here is a vision of the i18n API: > > LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); > lc.addResourceBundle( aResourceBundle); > > Logger loggerA = LoggerFactory.getLogger("A"); > Logger loggerB = LoggerFactory.getLogger("B"); > > // replace key_0 with its corresponding value in aResourceBundle > loggerA.info("key_0"); > > // same as before, but also insert the value of "param" as > specified in > // the message > loggerB.info("key_1", param); > > The above is just an *example* of what I mean by "vision" of the API. > > You can go a step further an implement something. You may wish to > fork SLF4J on git. The url is http://github.com/ceki/slf4j/tree/master Sounds like a good idea. I'll talk to Takeshi. > >> (Takeshi, correct me if this is incorrect). I think we can probably >> separate these features out when discussing. >> I think we would also need: >> - ability to specify the resource bundle to use when getting the >> logger >> - ability to use statics fields or just a string id embedded in >> call to logger > > Static field of type String? If the field is of type String, it does > not matter whether the variable is an instance variable of a static > one. (In a nutshell, I don't get it.) Yes, it has no practical impact on the implementation of course :-) From ceki at qos.ch Wed Aug 19 20:43:04 2009 From: ceki at qos.ch (Ceki Gulcu) Date: Wed, 19 Aug 2009 20:43:04 +0200 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <32FA3750-AB59-4945-A758-EE3AFA381E75@redhat.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <32FA3750-AB59-4945-A758-EE3AFA381E75@redhat.com> Message-ID: <4A8C47B8.4070109@qos.ch> Pete Muir wrote: > > Sorry, I was being loose with my language. I meant using an enumerated > type such as > > enum LogMessages { > > WRONG_PASSWORD, RIGHT_PASSWORD > } > > log.warn(WRONG_PASSWORD); What would the signature of log.warn() look like? Is the following legal java? interface Logger { void warn(enum e); } I don't think it is. > Yes, I'm also not sure that this is necessary, and it's certainly > another concern not really relating to i8n IMO. > >> >> Instead of debating the requirements, how about code that embodies >> your vision of the API (assuming everything was possible)? > > Hehe, sure, I definitely like to understand the requirements properly > first, but I know others prefer a hack first approach :-) Well, I did not actually mean to hack a complete solution but back up words with at least some example code. Otherwise, it gets too abstract for me... Previously, when I wrote: "You may wish to fork SLF4J on git." I meant to say githib not git. By the way, the archives for this discussion are available from http://www.slf4j.org/pipermail/dev/2009-August/date.html Thus, there is perhaps no need to cc Rodney, Takeshi and David. They can read the discussion from the archives if they wish to. If they wish to respond, they can do so after subscribing to the dev at slf4j mailing list. They can't respond to the mailing list without subscribing first. When replying, I won't add or remove addressed on my own initiative. -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch From pmuir at redhat.com Wed Aug 19 20:51:30 2009 From: pmuir at redhat.com (Pete Muir) Date: Wed, 19 Aug 2009 19:51:30 +0100 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <4A8C47B8.4070109@qos.ch> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <32FA3750-AB59-4945-A758-EE3AFA381E75@redhat.com> <4A8C47B8.4070109@qos.ch> Message-ID: On 19 Aug 2009, at 19:43, Ceki Gulcu wrote: > > > Pete Muir wrote: >> Sorry, I was being loose with my language. I meant using an >> enumerated type such as >> enum LogMessages { >> WRONG_PASSWORD, RIGHT_PASSWORD >> } >> log.warn(WRONG_PASSWORD); > > What would the signature of log.warn() look like? Is the following > legal java? > > interface Logger { > void warn(enum e); > } > > I don't think it is. This is valid in Java 5 and above. For example: public interface Logger { public enum LogMessages { WRONG_PASSWORD } public static class Test { public void test() { Logger logger = new Logger() { public void warn(Enum message) { // No-op, this is a mock } }; logger.warn(LogMessages.WRONG_PASSWORD); } } public void warn(Enum message); } Of course, this isn't valid in Java 1.4. > >> Yes, I'm also not sure that this is necessary, and it's certainly >> another concern not really relating to i8n IMO. >>> >>> Instead of debating the requirements, how about code that embodies >>> your vision of the API (assuming everything was possible)? >> Hehe, sure, I definitely like to understand the requirements >> properly first, but I know others prefer a hack first approach :-) > > Well, I did not actually mean to hack a complete solution but back > up words with at least some example code. Otherwise, it gets too > abstract for me... > > Previously, when I wrote: "You may wish to fork SLF4J on git." I > meant to say githib not git. > > By the way, the archives for this discussion are available from > http://www.slf4j.org/pipermail/dev/2009-August/date.html > > Thus, there is perhaps no need to cc Rodney, Takeshi and David. They > can read the discussion from the archives if they wish to. If they > wish to respond, they can do so after subscribing to the dev at slf4j > mailing list. They can't respond to the mailing list without > subscribing first. When replying, I won't add or remove addressed on > my own initiative. Good point, they know the discussion is happening now at least. I removed them from the cc. From ceki at qos.ch Wed Aug 19 21:38:58 2009 From: ceki at qos.ch (Ceki Gulcu) Date: Wed, 19 Aug 2009 21:38:58 +0200 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <32FA3750-AB59-4945-A758-EE3AFA381E75@redhat.com> <4A8C47B8.4070109@qos.ch> Message-ID: <4A8C54D2.4000904@qos.ch> Pete Muir wrote: > > This is valid in Java 5 and above. For example: > > public interface Logger { > > public enum LogMessages { > WRONG_PASSWORD > } > > public static class Test { > > public void test() { > Logger logger = new Logger() { > > public void warn(Enum message) { > // No-op, this is a mock > } > > }; > logger.warn(LogMessages.WRONG_PASSWORD); > } > } > > public void warn(Enum message); > } > Thank you. I now see how enums could be used but still don't see the advantage of using them. Just to be clear, given that there is a large existing user base for slf4j, we can't modify the org.slf4j.Logger interface, except perhaps its javadoc. So any extension of Logger needs to wrap/decorate org.slf4j.Logger. See for example, XLogger [1] and XLoggerFactory [2] in the slfj-ext module. [1] http://www.slf4j.org/xref/org/slf4j/ext/XLogger.html [2] http://www.slf4j.org/xref/org/slf4j/ext/XLoggerFactory.html -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch From rgoers at apache.org Wed Aug 19 22:42:53 2009 From: rgoers at apache.org (Ralph Goers) Date: Wed, 19 Aug 2009 13:42:53 -0700 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <014D9CDA-A9A4-4B50-A5DA-E8609EA17C9E@apache.org> <0A56E606-E28B-4850-988B-3DFD0E2A91A0@redhat.com> Message-ID: On Aug 19, 2009, at 11:21 AM, Pete Muir wrote: > I think we are making progress here, and actually there isn't too > much work to do. Let me paraphrase to make sure I am understanding > you correctly. > > * The source of messages should be abstracted behind an interface. A > default implementation that uses resource bundles could be provided > for easy ootb experience. Yes, > * The provision of the Locale should be an orthogonal concept to the > logging of messages and the creation of the Logger. This should be > handled via the MDC. "could be handled via the MDC". There are other ways to do it but that is probably the simplest. > > IMO there are still a few questions to answer: > > * Takeshi original design allowed you to use Enums as keys for > messages. I'm personally not sure about this, I'm not really sure > what benefits it offers over Strings as keys Enums are usually associated with an integer "value" and a String description. The only value is that you might be able to get some optimization by using the integer value of the enum in some cases. I don't know that it is worth the effort to support it. > * How does a framework provide translated messages [1] to i8ln > layer? Can we also use the MDC here to push them in, and have the > appender read them? I'm not sure I understand the question. The framework will provide a method like: public String getMessage(String key, Object[] params); However the messages are stored is hidden behind the implementation of that interface. Something has to call getMessage(). Potential places are a) the application before calling SLF4J b) SLF4J before calling a logging implementation, c) In the logging implementation - such as in the Appender. > * Should there be a convention for the key used? For example a key > should use a FQN. No. The key is essentially a contract between the application and whatever the backing repository is. Everything else should be ignorant. > * How does the integrate with the various slf4j back ends? Do we > somehow want to map it to the JDK logging i8ln support? What about > log4j? If you take the approach I recommend - do it as late as possible - then it is outside the scope of SLF4J. It might be done in the Appender for the logging framework in use or it might actually happen in the application that is reading the log files based on the Locale of the user reading them. > > [1] I'm assuming that a framework developer will want to provide > translations for it's logging messages No. An I18N framework would only provide the format the messages have to be stored in. Applications using the framework will provide their own message sets and presumably have experts who can localize the message sets provided by the development team into the desired locales. > > Regarding your suggestion to enhance logback - I want to be able to > provide l10n for my log messages regardless of which logging back > end is in use (for example, the framework I am currently working on > currently targets JBoss AS, GlassFish, and Tomcat as possible > runtimes, which use a combination of JDK logging and log4j). Again, that depends. For example, Lillith (http://freshmeat.net/projects/lilith-viewer ) is an event viewer for Logback. It would be very appropriate for it to do this. Likewise with Apache Chainsaw for Log4j. Doing the L10N further up the chain limits the flexibility these tools can provide. Sometimes that is desirable, but my recommendation is to always start from as far back as possible and move up the stack only as far as you have to. Ralph > > On 19 Aug 2009, at 17:16, Ralph Goers wrote: > >> >> On Aug 19, 2009, at 8:31 AM, Pete Muir wrote: >> >>> Hi Ralph, >>> >>> Whether or not resource bundles suck in our opinion, they are the >>> standard approach to this so I believe we can't just dismiss them. >> >> Let me rephrase. It isn't just that they suck. In my environment >> resource bundles don't work for I18N. I'm not in favor of having >> features implemented that I can't use. But my opinion doesn't >> really carry any more weight than yours. >> >>> >>> I'm also unsure how, in your approach, a framework would provide >>> i8ln'ized log messages which would be used? >> >> As I've said, I'm not at all in favor of SLF4J "doing" I18N. It is >> better to do it under a framework such as Spring's MessageSource >> interface where you can either use the default implementation, >> which uses ResourceBundles, or easily provide your own. As I said, >> I'm also planning on creating a framework to manage >> internationalized messages using Commons Configuration and XML files. >> >> In that scenario the application either calls getMessage() and then >> passes the resulting String to the log call or the application >> passes the message key as the message on the log call, which is the >> approach I would suggest. In the second scenario it is up to the >> Appender to resolve the key by calling getMessage(). Ideally, the >> Appender should be able to tell whether it is getting a key or the >> actual message text. This can be done simply by convention - i.e. a >> log message like "key=Message1" or by passing a parameter. There is >> no real need to enhance SLF4J to be able to do this. >> >> The piece that SLF4J is missing is the ability to detect the target >> Locale of the message. But even this can be handled without change >> to SLF4J. Just adding the Locale to the MDC would allow the >> Appender to do the right thing. Of course, you'd have to use a >> logging implementation that supports the MDC. >> >> In short, instead of asking for a change to SLF4J it would make >> more sense to me for you to ask for an enhancement to Logback so >> that any Appender can have the opportunity to internationalize the >> message. Currently you'd have to do that in a Layout, but I don't >> believe all Appenders support them. >> >> Ralph >> >> _______________________________________________ >> dev mailing list >> dev at slf4j.org >> http://www.slf4j.org/mailman/listinfo/dev > > _______________________________________________ > dev mailing list > dev at slf4j.org > http://www.slf4j.org/mailman/listinfo/dev From ceki at qos.ch Wed Aug 19 22:58:31 2009 From: ceki at qos.ch (Ceki Gulcu) Date: Wed, 19 Aug 2009 22:58:31 +0200 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <014D9CDA-A9A4-4B50-A5DA-E8609EA17C9E@apache.org> <0A56E606-E28B-4850-988B-3DFD0E2A91A0@redhat.com> Message-ID: <4A8C6777.7050306@qos.ch> Ralph Goers wrote: > > As I've said, I'm not at all in favor of SLF4J "doing" I18N. It is > better to do it under a framework such as Spring's MessageSource > interface where you can either use the default implementation, which > uses ResourceBundles, or easily provide your own. As I said, I'm also > planning on creating a framework to manage internationalized messages > using Commons Configuration and XML files. In a way, MessageFormatter [1] performs a similar function to a ResourceBundle. It is also noteworthy that currently MessageFormatter.format() is invoked within slf4j bindings. Previously, users had asked that the MessageFormatter implementation be pluggable. Unfortunately, this is not possible because if library A depends on MessageFormatter_A and library B depends on MessageFormatter_B, and if MessageFormatter_A and MessageFormatter_B use incompatible message formatting conventions, for example "hello {}" and "hello {0}", then choosing MessageFormatter_A as the implementation will screw up messages generated by library B. The same problem would occur with resource bundles or its spring equivalents. > In that scenario the application either calls getMessage() and then > passes the resulting String to the log call or the application passes > the message key as the message on the log call, which is the approach I > would suggest. In the second scenario it is up to the Appender to > resolve the key by calling getMessage(). Ideally, the Appender should be > able to tell whether it is getting a key or the actual message text. > This can be done simply by convention - i.e. a log message like > "key=Message1" or by passing a parameter. There is no real need to > enhance SLF4J to be able to do this. Assuming we had I18NLogger_1 wrapping/decorating o.slf4j.Logger, a printing method, say i18nInfo() could be implemented as: public class I18NLogger_1 extends LoggerWrapper implements Logger I18NLogger(Logger logger) { super(logger, I18NLogger_1.class.getName()); } void i18nInfo(String message, Object... params) { if(logger.isInfoEnabled()) { // aMessageSourceImpl is some implementation of // org.springframework.context.MessageSource or similar // interface String m = aMessageSourceImpl.getMessage(message, params, locale); logger.info(m); } } } In the above code, only aMessageSourceImpl and locale are not clearly defined. Another possible implementation for I18NLogger is as follows: public class I18NLogger_2 extends LoggerWrapper implements Logger I18NLogger_2(Logger logger) { super(logger, I18NLogger_2.class.getName()); } void i18nInfo(String message, Object... params) { if(logger.isInfoEnabled()) { // I18N is a marker for all internationalized messages logger.info(I18N, message, params); } } } In this second implementation, internationalization is done within the appropriate appender or possibly a new logback component (e.g. ILoggingEventTransformer) which would know how to internationalize messages. It would do so only for messages marked with I18N. The advantage of this second approach is that Joran (logback's internal configuration framework) can be leveraged to configure things pretty much the end-user wants. See for example SiftingAppender [2] which is heavily based on Joran. > The piece that SLF4J is missing is the ability to detect the target > Locale of the message. But even this can be handled without change to > SLF4J. Just adding the Locale to the MDC would allow the Appender to do > the right thing. Of course, you'd have to use a logging implementation > that supports the MDC. FYI, all slf4j bindings, including slf4j-jdk14 and even slf4j-nop ship with functional MDC support. It's just that the underlying logging framework does not make use of the provided MDC data. > In short, instead of asking for a change to SLF4J it would make more > sense to me for you to ask for an enhancement to Logback so that any > Appender can have the opportunity to internationalize the message. > Currently you'd have to do that in a Layout, but I don't believe all > Appenders support them. I don't know. Logback is tempting because of all the customization it allows. I could even imagine adding a new component, say ILoggingEventTransformer, which could transform logging events with internationalization being one particular type of transformation. If ILoggingEventTransformer came before appenders, it could transform the event for all appenders. Nevertheless, the main advantage of logback is all the additional customization made possible. For Web Beans, I am under the impression that all logging back ends need to be supported, hence I18NLogger_1. What were the requirements again? :-) > Ralph [1] http://slf4j.org/xref/org/slf4j/helpers/MessageFormatter.html [2] http://logback.qos.ch/manual/appenders.html#SiftingAppender -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch From ceki at qos.ch Wed Aug 19 23:15:30 2009 From: ceki at qos.ch (Ceki Gulcu) Date: Wed, 19 Aug 2009 23:15:30 +0200 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <014D9CDA-A9A4-4B50-A5DA-E8609EA17C9E@apache.org> <0A56E606-E28B-4850-988B-3DFD0E2A91A0@redhat.com> Message-ID: <4A8C6B72.7080102@qos.ch> Ralph Goers wrote: >> * The provision of the Locale should be an orthogonal concept to the >> logging of messages and the creation of the Logger. This should be >> handled via the MDC. > "could be handled via the MDC". There are other ways to do it but that > is probably the simplest. Pushing the locale in every thread will not suite everyone. >> IMO there are still a few questions to answer: >> >> * Takeshi original design allowed you to use Enums as keys for >> messages. I'm personally not sure about this, I'm not really sure what >> benefits it offers over Strings as keys > Enums are usually associated with an integer "value" and a String > description. The only value is that you might be able to get some > optimization by using the integer value of the enum in some cases. I > don't know that it is worth the effort to support it. Unless enums have some other advantage that we did not think of. Takeshi can you describe the advantages of enums that you see? >> * How does a framework provide translated messages [1] to i8ln layer? >> Can we also use the MDC here to push them in, and have the appender >> read them? > I'm not sure I understand the question. The framework will provide a > method like: > public String getMessage(String key, Object[] params); > However the messages are stored is hidden behind the implementation of > that interface. Something has to call getMessage(). Potential places are > a) the application before calling SLF4J b) SLF4J before calling a > logging implementation, c) In the logging implementation - such as in > the Appender. Bingo. a), b) or c) is the question. There is also a) and b) combined. See my previous message. > Again, that depends. For example, Lillith > (http://freshmeat.net/projects/lilith-viewer) is an event viewer for > Logback. It would be very appropriate for it to do this. Likewise with > Apache Chainsaw for Log4j. Doing the L10N further up the chain limits > the flexibility these tools can provide. Sometimes that is desirable, > but my recommendation is to always start from as far back as possible > and move up the stack only as far as you have to. If SLF4J or logback provided a reasonable solution, it would help developers in solving the logging i18n issue by the mere fact of offering and thus blessing a solution. It could only do harm if the offered solution was particularly stupid or bad. Moreover, the solution provided in slf4j or logback (or in both in part) could lay the foundation of a better solution imagined by one of our users. > Ralph -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch From rgoers at apache.org Wed Aug 19 23:21:14 2009 From: rgoers at apache.org (Ralph Goers) Date: Wed, 19 Aug 2009 14:21:14 -0700 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <4A8C6777.7050306@qos.ch> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <014D9CDA-A9A4-4B50-A5DA-E8609EA17C9E@apache.org> <0A56E606-E28B-4850-988B-3DFD0E2A91A0@redhat.com> <4A8C6777.7050306@qos.ch> Message-ID: <7750BF6E-D1CD-4126-A47D-C4707373B930@apache.org> On Aug 19, 2009, at 1:58 PM, Ceki Gulcu wrote: > > > Ralph Goers wrote: >> As I've said, I'm not at all in favor of SLF4J "doing" I18N. It is >> better to do it under a framework such as Spring's MessageSource >> interface where you can either use the default implementation, >> which uses ResourceBundles, or easily provide your own. As I said, >> I'm also planning on creating a framework to manage >> internationalized messages using Commons Configuration and XML files. > > In a way, MessageFormatter [1] performs a similar function to a > ResourceBundle. It is also noteworthy that currently > MessageFormatter.format() is invoked within slf4j bindings. > Previously, users had asked that the MessageFormatter implementation > be pluggable. Unfortunately, this is not possible because if library > A depends on MessageFormatter_A and library B depends on > MessageFormatter_B, and if MessageFormatter_A and MessageFormatter_B > use incompatible message formatting conventions, for example "hello > {}" and "hello {0}", then choosing MessageFormatter_A as the > implementation will screw up messages generated by library B. The > same problem would occur with resource bundles or its spring > equivalents. While an I18N framework might do some sort of message formatting itself it wouldn't replace MessageFormatter.format(). In otherwords, lets say I have a couple of message definitions like Bank of America Welcome to ${name}, {} In this case one would hope that the framework would return "Welcome to Bank of America, {}". Presumably SLF4J's usual mechanism would replace the runtime variable. OTOH, if the formatting is deferred to the Appender then obviously the runtime variables would have to be replaced there. Many of the current I18N frameworks use the normal Java formatter for that. > >> In that scenario the application either calls getMessage() and then >> passes the resulting String to the log call or the application >> passes the message key as the message on the log call, which is the >> approach I would suggest. In the second scenario it is up to the >> Appender to resolve the key by calling getMessage(). Ideally, the >> Appender should be able to tell whether it is getting a key or the >> actual message text. This can be done simply by convention - i.e. a >> log message like "key=Message1" or by passing a parameter. There is >> no real need to enhance SLF4J to be able to do this. > > Assuming we had I18NLogger_1 wrapping/decorating o.slf4j.Logger, a > printing method, say i18nInfo() could be implemented as: > > public class I18NLogger_1 extends LoggerWrapper implements Logger > > I18NLogger(Logger logger) { > super(logger, I18NLogger_1.class.getName()); > } > > void i18nInfo(String message, Object... params) { > if(logger.isInfoEnabled()) { > // aMessageSourceImpl is some implementation of > // org.springframework.context.MessageSource or similar > // interface > String m = aMessageSourceImpl.getMessage(message, params, > locale); > logger.info(m); > } > } > } > > In the above code, only aMessageSourceImpl and locale are not > clearly defined. > > Another possible implementation for I18NLogger is as follows: > > public class I18NLogger_2 extends LoggerWrapper implements Logger > > I18NLogger_2(Logger logger) { > super(logger, I18NLogger_2.class.getName()); > } > > void i18nInfo(String message, Object... params) { > if(logger.isInfoEnabled()) { > // I18N is a marker for all internationalized messages > logger.info(I18N, message, params); > } > } > } > > In this second implementation, internationalization is done within > the appropriate appender or possibly a new logback component (e.g. > ILoggingEventTransformer) which would know how to > internationalize messages. It would do so only for messages marked > with I18N. Wow. How stupid of me. I completely forgot about Markers. That is an obvious and very good way of indicating whether the message is a key or text. > > The advantage of this second approach is that Joran (logback's > internal configuration framework) can be leveraged to configure > things pretty much the end-user wants. See for example > SiftingAppender [2] which is heavily based on Joran. > >> The piece that SLF4J is missing is the ability to detect the target >> Locale of the message. But even this can be handled without change >> to SLF4J. Just adding the Locale to the MDC would allow the >> Appender to do the right thing. Of course, you'd have to use a >> logging implementation that supports the MDC. > > FYI, all slf4j bindings, including slf4j-jdk14 and even slf4j-nop > ship with functional MDC support. It's just that the underlying > logging framework does not make use of the provided MDC data. Sure. But how would you write a Handler for JUL that could do it? > >> In short, instead of asking for a change to SLF4J it would make >> more sense to me for you to ask for an enhancement to Logback so >> that any Appender can have the opportunity to internationalize the >> message. Currently you'd have to do that in a Layout, but I don't >> believe all Appenders support them. > > I don't know. Logback is tempting because of all the customization > it allows. I could even imagine adding a new component, say > ILoggingEventTransformer, which could transform logging events with > internationalization being one particular type of transformation. If > ILoggingEventTransformer came before appenders, it could transform > the event for all appenders. Nevertheless, the main advantage of > logback is all the additional customization made possible. Yes. Doing it that way would be beneficial to some Logback users. Hopefully, it would still allow the message to be left unresolved in the case where the customer wants to write the message key and parameters to a database, not the localized message. > > For Web Beans, I am under the impression that all logging back ends > need to be supported, hence I18NLogger_1. > > What were the requirements again? :-) Lol. Ralph From rgoers at apache.org Wed Aug 19 23:31:54 2009 From: rgoers at apache.org (Ralph Goers) Date: Wed, 19 Aug 2009 14:31:54 -0700 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <4A8C6B72.7080102@qos.ch> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <014D9CDA-A9A4-4B50-A5DA-E8609EA17C9E@apache.org> <0A56E606-E28B-4850-988B-3DFD0E2A91A0@redhat.com> <4A8C6B72.7080102@qos.ch> Message-ID: <44F44E34-DD87-4104-82CD-F639A73D9B76@apache.org> On Aug 19, 2009, at 2:15 PM, Ceki Gulcu wrote: > Ralph Goers wrote: >>> * The provision of the Locale should be an orthogonal concept to >>> the logging of messages and the creation of the Logger. This >>> should be handled via the MDC. >> "could be handled via the MDC". There are other ways to do it but >> that is probably the simplest. > > Pushing the locale in every thread will not suite everyone. Probably not. In those cases the method you described before using the LoggerContext would probably work. But it depends on the use case. In a lot of systems the operations staff will want all the log messages in a single language of the locale where the software is running and the locale of the end user will be irrelevant. In cases like event logging it may be that the event logs are viewed by customer service reps speaking in multiple languages. In that case the locale of the person viewing the log is important (which may be days or months after the log entry was recorded). The least critical scenario, in my opinion, is where the log entry will be viewed by the end user. IMO this isn't the best use of a logging system. OTOH, in my case we would still put the locale of the end user in the MDC simply because other GUI components will want that information. > >>> IMO there are still a few questions to answer: >>> >>> * Takeshi original design allowed you to use Enums as keys for >>> messages. I'm personally not sure about this, I'm not really sure >>> what benefits it offers over Strings as keys >> Enums are usually associated with an integer "value" and a String >> description. The only value is that you might be able to get some >> optimization by using the integer value of the enum in some cases. >> I don't know that it is worth the effort to support it. > > Unless enums have some other advantage that we did not think of. > Takeshi can you describe the advantages of enums that you see? > >>> * How does a framework provide translated messages [1] to i8ln >>> layer? Can we also use the MDC here to push them in, and have the >>> appender read them? >> I'm not sure I understand the question. The framework will provide >> a method like: >> public String getMessage(String key, Object[] params); >> However the messages are stored is hidden behind the implementation >> of that interface. Something has to call getMessage(). Potential >> places are a) the application before calling SLF4J b) SLF4J before >> calling a logging implementation, c) In the logging implementation >> - such as in the Appender. > > Bingo. a), b) or c) is the question. There is also a) and b) > combined. See my previous message. > >> Again, that depends. For example, Lillith (http://freshmeat.net/projects/lilith-viewer >> ) is an event viewer for Logback. It would be very appropriate for >> it to do this. Likewise with Apache Chainsaw for Log4j. Doing the >> L10N further up the chain limits the flexibility these tools can >> provide. Sometimes that is desirable, but my recommendation is to >> always start from as far back as possible and move up the stack >> only as far as you have to. > > If SLF4J or logback provided a reasonable solution, it would help > developers in solving the logging i18n issue by the mere fact of > offering and thus blessing a solution. It could only do harm if the > offered solution was particularly stupid or bad. Moreover, the > solution provided in slf4j or logback (or in both in part) could lay > the foundation of a better solution imagined by one of our users. +1. That is why we would want to consider several use cases. I don't think there is a one size fits all solution. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From ceki at qos.ch Wed Aug 19 23:41:14 2009 From: ceki at qos.ch (Ceki Gulcu) Date: Wed, 19 Aug 2009 23:41:14 +0200 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <44F44E34-DD87-4104-82CD-F639A73D9B76@apache.org> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <014D9CDA-A9A4-4B50-A5DA-E8609EA17C9E@apache.org> <0A56E606-E28B-4850-988B-3DFD0E2A91A0@redhat.com> <4A8C6B72.7080102@qos.ch> <44F44E34-DD87-4104-82CD-F639A73D9B76@apache.org> Message-ID: <4A8C717A.6040602@qos.ch> Ralph Goers wrote: > > In cases like event logging it may be that the event logs > are viewed by customer service reps speaking in multiple languages. In > that case the locale of the person viewing the log is important (which > may be days or months after the log entry was recorded). Very good point which previously had not occurred to me. -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch From git-noreply at pixie.qos.ch Thu Aug 20 01:29:54 2009 From: git-noreply at pixie.qos.ch (added by portage for gitosis-gentoo) Date: Thu, 20 Aug 2009 01:29:54 +0200 (CEST) Subject: [slf4j-dev] [GIT] SLF4J: Simple Logging Facade for Java branch, master, updated. 8a69afbdd1ae182456d87f774fc3f5f32ca33106 Message-ID: <20090819232954.ED6952E41C6@pixie.qos.ch> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SLF4J: Simple Logging Facade for Java". The branch, master has been updated via 8a69afbdd1ae182456d87f774fc3f5f32ca33106 (commit) from d279daad1937d1ec6e5086d18b3426182058c31f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 8a69afbdd1ae182456d87f774fc3f5f32ca33106 Author: Ceki Gulcu Date: Thu Aug 20 01:28:11 2009 +0200 removed spaces ----------------------------------------------------------------------- Summary of changes: slf4j-site/src/site/pages/templates/left.js | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-) hooks/post-receive -- SLF4J: Simple Logging Facade for Java From git-noreply at pixie.qos.ch Thu Aug 20 14:22:50 2009 From: git-noreply at pixie.qos.ch (added by portage for gitosis-gentoo) Date: Thu, 20 Aug 2009 14:22:50 +0200 (CEST) Subject: [slf4j-dev] [GIT] SLF4J: Simple Logging Facade for Java branch, master, updated. 71f60822332228393c191277b862bf081d2bf47c Message-ID: <20090820122250.340132E456B@pixie.qos.ch> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SLF4J: Simple Logging Facade for Java". The branch, master has been updated via 71f60822332228393c191277b862bf081d2bf47c (commit) from 4360851b199f4af823abdb854565bde26f758f18 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.qos.ch/?p=slf4j.git;a=commit;h=71f60822332228393c191277b862bf081d2bf47c http://github.com/ceki/slf4j/commit/71f60822332228393c191277b862bf081d2bf47c commit 71f60822332228393c191277b862bf081d2bf47c Author: Ceki Gulcu Date: Thu Aug 20 14:21:16 2009 +0200 fixed typos diff --git a/slf4j-site/src/site/pages/news.html b/slf4j-site/src/site/pages/news.html index ca86ac7..9bd69a9 100644 --- a/slf4j-site/src/site/pages/news.html +++ b/slf4j-site/src/site/pages/news.html @@ -77,7 +77,7 @@ with JDK 1.4 and earlier but only if a version incompatibility issue was present. For example, if you were mixing slf4j-api-1.5.6.jar with slf4j-simple-1.4.2.jar, - which are mutually incompatile. Please note that this bug affects + which are mutually incompatible. Please note that this bug affects only SLF4J versions 1.5.5 and 1.5.6 and only in the presence of incompatible versions of slf4j-api and its binding.

    @@ -492,7 +492,7 @@

    Fixed bug 53 as reported by Heinrich Nirschl. The public method trace(String) in the Log4jLoggerAdapter - class incorrecly called the underlying log4j logger with level DEBUG + class incorrectly called the underlying log4j logger with level DEBUG instead of TRACE.

    @@ -662,8 +662,8 @@ 29.

    -

    Fixed a syncroisation problem in factories of almost all SLF4J - bindings. This bug was reported independenly by Howard M. Lewis Ship +

    Fixed a synchronization problem in factories of almost all SLF4J + bindings. This bug was reported independently by Howard M. Lewis Ship and Boris Unkel in bug reports 26 and respectively References: <20090820122250.340132E456B@pixie.qos.ch> Message-ID: <4A8D4178.9040505@qos.ch> Hello all, Given that git is in my opinion such a clearly better version control system than Subversion, I migrated the SLF4J svn repository to git. It was easier than expected. There are two master repositories, one hosted at git.qos.ch and the other hosted at github. For more information on these repositories, please see http://www.slf4j.org/repos.html I had hoped to keep the Subversion repository as a mirror, but it appears that that would be too much of a hassle. Your comments or questions are welcome. -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch From jukka.zitting at gmail.com Thu Aug 20 14:38:16 2009 From: jukka.zitting at gmail.com (Jukka Zitting) Date: Thu, 20 Aug 2009 14:38:16 +0200 Subject: [slf4j-dev] Migrated to git In-Reply-To: <4A8D4178.9040505@qos.ch> References: <20090820122250.340132E456B@pixie.qos.ch> <4A8D4178.9040505@qos.ch> Message-ID: <510143ac0908200538m20db7989v35df77c85f867d46@mail.gmail.com> Hi, On Thu, Aug 20, 2009 at 2:28 PM, Ceki Gulcu wrote: > Given that git is in my opinion such a clearly better version control > system than Subversion, I migrated the SLF4J svn repository to git. Nice! It would be useful to have the old svn branches and tags also reflected in the slf4j.git repository. If you used the standard layout option to git-svn when migrating the code, they actually should already exist as remote branches. Copying the references to normal branches and tags in slf4j.git should do the trick. > I had hoped to keep the Subversion repository as a mirror, but it > appears that that would be too much of a hassle. Agreed. I suppose I can shutdown svn-mirror.slf4j.org then. BR, Jukka Zitting From ceki at qos.ch Thu Aug 20 15:09:14 2009 From: ceki at qos.ch (Ceki Gulcu) Date: Thu, 20 Aug 2009 15:09:14 +0200 Subject: [slf4j-dev] Migrated to git In-Reply-To: <510143ac0908200538m20db7989v35df77c85f867d46@mail.gmail.com> References: <20090820122250.340132E456B@pixie.qos.ch> <4A8D4178.9040505@qos.ch> <510143ac0908200538m20db7989v35df77c85f867d46@mail.gmail.com> Message-ID: <4A8D4AFA.3030501@qos.ch> Jukka Zitting wrote: > Hi, > It would be useful to have the old svn branches and tags also > reflected in the slf4j.git repository. If you used the standard layout > option to git-svn when migrating the code, they actually should > already exist as remote branches. Copying the references to normal > branches and tags in slf4j.git should do the trick. I forgot to copy the remote references as normal references. Consequently, the original svn tags were lost. I guess I'll have to start over. Bummer. >> I had hoped to keep the Subversion repository as a mirror, but it >> appears that that would be too much of a hassle. > > Agreed. I suppose I can shutdown svn-mirror.slf4j.org then. Could you wait a few weeks before shutting down svn-mirror? It came in handy a few days ago and might be again. In the absence of a contrary message, you can safely close svn-mirror around mid-september. Is that OK with you? In any case, I very much appreciate your help. > Jukka Zitting -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch From jukka.zitting at gmail.com Thu Aug 20 15:11:58 2009 From: jukka.zitting at gmail.com (Jukka Zitting) Date: Thu, 20 Aug 2009 15:11:58 +0200 Subject: [slf4j-dev] Migrated to git In-Reply-To: <4A8D4AFA.3030501@qos.ch> References: <20090820122250.340132E456B@pixie.qos.ch> <4A8D4178.9040505@qos.ch> <510143ac0908200538m20db7989v35df77c85f867d46@mail.gmail.com> <4A8D4AFA.3030501@qos.ch> Message-ID: <510143ac0908200611w6b7f07c2td25f9a0c15eba429@mail.gmail.com> Hi, On Thu, Aug 20, 2009 at 3:09 PM, Ceki Gulcu wrote: > Could you wait a few weeks before shutting down svn-mirror? It came in handy > a few days ago and might be again. In the absence of a contrary message, you > can safely close svn-mirror around mid-september. Is that OK with you? Sure, no problem. BR, Jukka Zitting From takeshi.kondo at gmail.com Thu Aug 20 17:22:33 2009 From: takeshi.kondo at gmail.com (=?ISO-2022-JP?B?GyRCNmFGIxsoQiAbJEI3chsoQg==?=) Date: Fri, 21 Aug 2009 00:22:33 +0900 Subject: [slf4j-dev] slf4j i8ln Message-ID: <5E5AC828-7E47-446E-8A56-758428CD1BC1@gmail.com> My idea is using enum as log message definition. enum value is log message id and log message is annotation value associated with enum. -------------- sample code -------------- public interface Logger { public enum LogMessages { @Message("wrong password") // log message is annotation value. WRONG_PASSWORD // enum value is log id. } public static class Test { public void test() { Logger logger = new Logger() { public void warn(Enum message) { // No-op, this is a mock } }; logger.warn(LogMessages.WRONG_PASSWORD); } } public void warn(Enum logid); } --- I think there is advantage using enum definition discussed below. enum has information of package and definition class and field. Using this feature , I've designed 3 feature. 1. log message definition using enum For example sample code, it can define enum with log message. so developer don't need to write property file. property file must ensure consistency to log id by hand. enum and annotation do by compiler. 2. default property file Because enum has class definition, log api is referable declared class of enum. Log api can load propery file from using declared class name. for example if enum class name is "example.LogMessages", default propery file is "example/LogMessages.properties". 3. package EnumMap must create per?enum class. so if log id is enum, they aren't duplication. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rgoers at apache.org Thu Aug 20 17:35:28 2009 From: rgoers at apache.org (Ralph Goers) Date: Thu, 20 Aug 2009 08:35:28 -0700 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <5E5AC828-7E47-446E-8A56-758428CD1BC1@gmail.com> References: <5E5AC828-7E47-446E-8A56-758428CD1BC1@gmail.com> Message-ID: <71F65411-FCC6-4B01-96A1-2EED72EB6A83@apache.org> On Aug 20, 2009, at 8:22 AM, ?? ? wrote: > > --- > > I think there is advantage using enum definition discussed below. > > enum has information of package and definition class and field. > Using this feature , I've designed 3 feature. > > 1. log message definition using enum > For example sample code, it can define enum with log message. so > developer don't need to write property file. property file must > ensure consistency to log id by hand. enum and annotation do by > compiler. This is interesting. Providing the non-internationalized message text along with the key would make it easy to create a non-localized version of a product and then localize it later just by adding files. > > 2. default property file > Because enum has class definition, log api is referable declared > class of enum. > Log api can load propery file from using declared class name. > for example if enum class name is "example.LogMessages", default > propery file is "example/LogMessages.properties". Keep in mind that it isn't a great idea to have the localized files only be able to be loaded via the classloader. Ideally, they should be in a CMS. However, this pattern could still be useful for that. It is handy having the "bundle name" associated with the key. > > 3. package > EnumMap must create per?enum class. so if log id is enum, > they aren't duplication. > You're saying this prevents duplicate message keys? This one is not something I worry about. In this approach SLF4J would at least have to be able to serialize the enum and include the relevant parts - the class name, id and message. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From ceki at qos.ch Thu Aug 20 18:11:11 2009 From: ceki at qos.ch (Ceki Gulcu) Date: Thu, 20 Aug 2009 18:11:11 +0200 Subject: [slf4j-dev] rebuilding git repositories Message-ID: <4A8D759F.5010503@qos.ch> Hello all, I am rebuilding both the slf4j and logback git repositories. A new version should be available in the coming hour or so. If you had cloned an earlier version of either the slf4j or logback repo, I am afraid you'll need to clone again. My apologies for the hassle, -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch From rgoers at apache.org Thu Aug 20 18:55:39 2009 From: rgoers at apache.org (ralph.goers @dslextreme.com) Date: Thu, 20 Aug 2009 09:55:39 -0700 Subject: [slf4j-dev] Migrated to git In-Reply-To: <4A8D4178.9040505@qos.ch> References: <20090820122250.340132E456B@pixie.qos.ch> <4A8D4178.9040505@qos.ch> Message-ID: <2bacf5dd0908200955w18f44832mf75483db6da3dfa3@mail.gmail.com> Do the git commands to clone and interact with the remote repository use http or webdav as subversion does? If not it will be very difficult for me to work on SLF4J or Logback while behind my employer's firewall as most ports are blocked. Ralph On Thu, Aug 20, 2009 at 5:28 AM, Ceki Gulcu wrote: > Hello all, > > Given that git is in my opinion such a clearly better version control > system than Subversion, I migrated the SLF4J svn repository to git. It > was easier than expected. > > There are two master repositories, one hosted at git.qos.ch and the > other hosted at github. For more information on these repositories, > please see http://www.slf4j.org/repos.html > > I had hoped to keep the Subversion repository as a mirror, but it > appears that that would be too much of a hassle. > > Your comments or questions are welcome. > > -- > Ceki G?lc? > Logback: The reliable, generic, fast and flexible logging framework for > Java. > http://logback.qos.ch > _______________________________________________ > dev mailing list > dev at slf4j.org > http://www.slf4j.org/mailman/listinfo/dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From takeshi.kondo at gmail.com Thu Aug 20 19:07:13 2009 From: takeshi.kondo at gmail.com (Takeshi Kondo) Date: Fri, 21 Aug 2009 02:07:13 +0900 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <4A8C41E9.6030908@qos.ch> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> Message-ID: <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> > > Takeshi mentioned that his requirement was to be able to change the > level of a logging statement without needing to recompile his > application. I don't see how annotations help in this case since > they also need to be recompiled. > I think annotation is default value. In development, I don't want to write property file because property file isn't type safe. so I want to use annotation. In contrast, after deployment I don't want to recompile our application because redeployment process is onerous task. so I want to use property file. Who should develop log level? I think application developer develop default log level, and operator develop actual log level. I can't design all log level if it doesn't operate it. > Markers allow for a cleaner way of filtering out messages. Changing > the level is unnecessary. For example, if all logging events of > level ERROR trigger an alarm, and if a certain ERROR event should > not trigger an alarm, you can mark that particular event with the > "NO_ALARM" marker. All right, I think so. In this use case ,If I can mark that particular ERROR event with the "NO_ALARM" marker without recompile. I don't need it. In other use case, I usually change particular log level from debug to info to analyze trouble after deployment. In this use case, I think Markers don't resolve it. Because debug logging code is if( logger.isDebugEnabled()){ logger.debug("debug log message ...."); } logger.isDebugEnabled() is false, then debug log even don't occur. ---- If log level is separated, logging code is ---- public class enum LogMessages{ @Debug("debug log message") TEST0001 } if(logger.isEnableFor(LogMessages.TEST0001)){ logger.log(LogMessages.TEST0001); } ---- If change log level, logger.isEnableFor(LogMessages.TEST0001) is true , then log event occur. Of course, if we can change log configuration, it is usually solved. But because log configuration is per category,it can't configure per log message id. > Instead of debating the requirements, how about code that embodies > your vision of the API (assuming everything was possible)? > > For example, here is a vision of the i18n API: > > LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); > lc.addResourceBundle( aResourceBundle); > > Logger loggerA = LoggerFactory.getLogger("A"); > Logger loggerB = LoggerFactory.getLogger("B"); > > // replace key_0 with its corresponding value in aResourceBundle > loggerA.info("key_0"); > > // same as before, but also insert the value of "param" as > specified in > // the message > loggerB.info("key_1", param); > > The above is just an *example* of what I mean by "vision" of the API. > > You can go a step further an implement something. You may wish to > fork SLF4J on git. The url is http://github.com/ceki/slf4j/tree/master OK. I've develop initial thought of i18n API on this week end. Takeshi Kondo From ceki at qos.ch Thu Aug 20 19:17:33 2009 From: ceki at qos.ch (Ceki Gulcu) Date: Thu, 20 Aug 2009 19:17:33 +0200 Subject: [slf4j-dev] Migrated to git In-Reply-To: <2bacf5dd0908200955w18f44832mf75483db6da3dfa3@mail.gmail.com> References: <20090820122250.340132E456B@pixie.qos.ch> <4A8D4178.9040505@qos.ch> <2bacf5dd0908200955w18f44832mf75483db6da3dfa3@mail.gmail.com> Message-ID: <4A8D852D.30002@qos.ch> I think git supports a whole bunch of protocols including http and/or webdav. The git.qos.ch server currently supports SSH (port 22) and the git protocol (port 9418). Github allows you to fork the repository, but the forked version, as far as I could tell, is accessible only via the git protocol. Both git.qos.ch and githib can create .zip or tar.gz files of a snapshot with just one click. You get the whole source code (but not the .git repository). Anyway, I'll have to explore how http could be supported. ralph.goers @dslextreme.com wrote: > Do the git commands to clone and interact with the remote repository use > http or webdav as subversion does? If not it will be very difficult for > me to work on SLF4J or Logback while behind my employer's firewall as > most ports are blocked. > > Ralph -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch From rgoers at apache.org Thu Aug 20 19:20:59 2009 From: rgoers at apache.org (ralph.goers @dslextreme.com) Date: Thu, 20 Aug 2009 10:20:59 -0700 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> Message-ID: <2bacf5dd0908201020i1ce3bc95k8954e61f587595bd@mail.gmail.com> On Thu, Aug 20, 2009 at 10:07 AM, Takeshi Kondo wrote: > > If log level is separated, logging code is > ---- > public class enum LogMessages{ > @Debug("debug log message") > TEST0001 > } > > if(logger.isEnableFor(LogMessages.TEST0001)){ > logger.log(LogMessages.TEST0001); > } > ---- > If change log level, logger.isEnableFor(LogMessages.TEST0001) is true , > then log event occur. Actually, when using logger.log(LogMessages.TEST0001) isEnableFor is useless and shouldn't be called. The log method is going to do that check again. But your point is well taken that the application programmer doesn't have to know the log level when writing the code. > > Of course, if we can change log configuration, it is usually solved. But > because log configuration is per category,it can't configure per log message > id. > > > Instead of debating the requirements, how about code that embodies your >> vision of the API (assuming everything was possible)? >> >> For example, here is a vision of the i18n API: >> >> LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); >> lc.addResourceBundle( aResourceBundle); >> >> Logger loggerA = LoggerFactory.getLogger("A"); >> Logger loggerB = LoggerFactory.getLogger("B"); >> >> // replace key_0 with its corresponding value in aResourceBundle >> loggerA.info("key_0"); >> >> // same as before, but also insert the value of "param" as specified in >> // the message >> loggerB.info("key_1", param); >> >> The above is just an *example* of what I mean by "vision" of the API. >> >> You can go a step further an implement something. You may wish to fork >> SLF4J on git. The url is http://github.com/ceki/slf4j/tree/master >> > OK. I've develop initial thought of i18n API on this week end. > > I'd love to see what you come up with. I'm seriously thinking that XLogger could be enhanced with some of these ideas. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From ceki at qos.ch Thu Aug 20 22:49:40 2009 From: ceki at qos.ch (Ceki Gulcu) Date: Thu, 20 Aug 2009 22:49:40 +0200 Subject: [slf4j-dev] Migrated to git In-Reply-To: <4A8D852D.30002@qos.ch> References: <20090820122250.340132E456B@pixie.qos.ch> <4A8D4178.9040505@qos.ch> <2bacf5dd0908200955w18f44832mf75483db6da3dfa3@mail.gmail.com> <4A8D852D.30002@qos.ch> Message-ID: <4A8DB6E4.6020701@qos.ch> Added http support for cloning. See http://slf4j.org/repos.html Ceki Gulcu wrote: > > I think git supports a whole bunch of protocols including http and/or > webdav. The git.qos.ch server currently supports SSH (port 22) and the > git protocol (port 9418). > > Github allows you to fork the repository, but the forked version, as far > as I could tell, is accessible only via the git protocol. > > Both git.qos.ch and githib can create .zip or tar.gz files of a snapshot > with just one click. You get the whole source code (but not the .git > repository). Anyway, I'll have to explore how http could be supported. > > ralph.goers @dslextreme.com wrote: >> Do the git commands to clone and interact with the remote repository >> use http or webdav as subversion does? If not it will be very >> difficult for me to work on SLF4J or Logback while behind my >> employer's firewall as most ports are blocked. >> >> Ralph > -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch From ceki at qos.ch Thu Aug 20 22:58:45 2009 From: ceki at qos.ch (Ceki Gulcu) Date: Thu, 20 Aug 2009 22:58:45 +0200 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> Message-ID: <4A8DB905.60303@qos.ch> Takeshi Kondo wrote: > If log level is separated, logging code is > ---- > public class enum LogMessages{ > @Debug("debug log message") > TEST0001 > } > Doesn't LogMessages need to be compiled? If LogMessages needs compiling, how is it helpful? -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch From ceki at qos.ch Thu Aug 20 23:06:05 2009 From: ceki at qos.ch (Ceki Gulcu) Date: Thu, 20 Aug 2009 23:06:05 +0200 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> Message-ID: <4A8DBABD.8050504@qos.ch> Takeshi Kondo wrote: > public class enum LogMessages{ > @Debug("debug log message") > TEST0001 > } If I followed you, the idea is to encode the resource bundle *keys* within enums. You still need to check the consistency of the resource bundle keys, including copies found in various language variations so that they match the enums. I can see how this would be useful if the IDE somehow knew about the the resource bundle keys and the enums and cross checked things. Without tooling support, one would still need to manually match the enum keys with those found in resource bundle. I still don't see the gain with enums. What am I missing? -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch From takeshi.kondo at gmail.com Sat Aug 22 07:28:18 2009 From: takeshi.kondo at gmail.com (Takeshi Kondo) Date: Sat, 22 Aug 2009 14:28:18 +0900 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> Message-ID: <8D5C6BEC-C4B6-400D-A96B-C88716A6D390@gmail.com> > If I followed you, the idea is to encode the resource bundle *keys* > within > enums. You still need to check the consistency of the resource > bundle keys, > including copies found in various language variations so that they > match the > enums. I can see how this would be useful if the IDE somehow knew > about the the > resource bundle keys and the enums and cross checked things. Without > tooling > support, one would still need to manually match the enum keys with > those found > in resource bundle. I still don't see the gain with enums. What am I > missing? You don't understand my idea a little. My idea is to use enums as log message id. The resource bundle keys is one of ways binding enums to log messages. Of cause, we need to check the consistency of the resource bundle keys. > public class enum LogMessages{ > @Debug("debug log message") > TEST0001 > } Log level annotation is one of ways. This is type safe. If we follow up type safe, there is my thinking idea. ---- Binding enums to log messages by coding ---- public class JapanLogMessages implements LocalizedMessage{ // return target locale public Locale locale() { return Locale.JAPAN; // target local } // return message bound log message id. public String toMessage(LogMessages logId){ switch (logId){ case TEST0001: // log message id return "japanene log message"; // return localized message } return null; } } ---- Switch case is type safe. In development, enums is useful because it is type safe. I think enums have application possibility. From takeshi.kondo at gmail.com Sun Aug 23 07:32:04 2009 From: takeshi.kondo at gmail.com (Takeshi Kondo) Date: Sun, 23 Aug 2009 14:32:04 +0900 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> Message-ID: <696A920C-B79E-4F21-BA13-784D34E8D023@gmail.com> A non-text attachment was scrubbed... Name: slf4j-i18n-1.5.9-SNAPSHOT.jar Type: application/java-archive Size: 29992 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: slf4j-i18n-1.5.9-SNAPSHOT-sources.jar Type: application/java-archive Size: 14197 bytes Desc: not available URL: -------------- next part -------------- I've developed initial thought of SLF4j's i18n extension. It was committed to my branch (http://github.com/takeshi/slf4j/tree/master ). I've implemented 4 features as follows. 1. Logger interface using enum. @see org.slf4j.i18n.I18NLogger 2. Extension point to bind log id's enum to log message and level. @see org.slf4j.i18n.spi.LogLevelResolver @see org.slf4j.i18n.spi.LogMessageFormatResolver 3. Resolving log message and log level from Annotation associated from log id's enum. @see org.slf4j.i18n.impl.AnnotationLogLevelResolver @see org.slf4j.i18n.impl.AnnotationMessageFormatResolver 4. Resolving log message and log level from ResourceBundle associated with log id's enum. @see org.slf4j.i18n.impl.ResourceBundleLogLevelResolver @see org.slf4j.i18n.impl.ResourceBundleMessageFormatResolver For example: ---- Log Message Definition ---- public enum LogMessages { @Error("error message {}") // log level is bound to Error. TEST0001, @Message("waring message {}") // log level is not specified. TEST0002 } ---- Logging ---- public static void main(String[] args) { I18NLogger logger = I18NLoggerFactory.getLogger(LogMain.class); // write to error log , because LogMessages.TEST0001 is bound to Error level. logger.log(LogMessages.TEST0001, "xxxx"); logger.log(LogMessages.TEST0001, new NullPointerException()); // write log as error level. logger.error(LogMessages.TEST0002, "xxxx"); // write log as warn level. logger.warn(LogMessages.TEST0002, new NullPointerException()); } Takeshi Kondo From bugzilla-daemon at pixie.qos.ch Sun Aug 23 14:27:24 2009 From: bugzilla-daemon at pixie.qos.ch (bugzilla-daemon at pixie.qos.ch) Date: Sun, 23 Aug 2009 14:27:24 +0200 (CEST) Subject: [slf4j-dev] [Bug 31] Varargs for Logger methods In-Reply-To: Message-ID: <20090823122724.68A422F8225@pixie.qos.ch> http://bugzilla.slf4j.org/show_bug.cgi?id=31 Thomas Timbul changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |thomas at gtsquare.com -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. From rgoers at apache.org Sun Aug 23 17:21:16 2009 From: rgoers at apache.org (Ralph Goers) Date: Sun, 23 Aug 2009 08:21:16 -0700 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <696A920C-B79E-4F21-BA13-784D34E8D023@gmail.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> <696A920C-B79E-4F21-BA13-784D34E8D023@gmail.com> Message-ID: I'm out of town on vacation right now so I might not get a chance to review this for a couple of days. But I'd like to provide my feedback before anything is incorporated. Ralph On Aug 22, 2009, at 10:32 PM, Takeshi Kondo wrote: > > > I've developed initial thought of SLF4j's i18n extension. > It was committed to my branch (http://github.com/takeshi/slf4j/tree/master > ). > > I've implemented 4 features as follows. > > 1. Logger interface using enum. > @see org.slf4j.i18n.I18NLogger > > 2. Extension point to bind log id's enum to log message and level. > @see org.slf4j.i18n.spi.LogLevelResolver > @see org.slf4j.i18n.spi.LogMessageFormatResolver > > 3. Resolving log message and log level from Annotation associated > from log id's enum. > @see org.slf4j.i18n.impl.AnnotationLogLevelResolver > @see org.slf4j.i18n.impl.AnnotationMessageFormatResolver > > 4. Resolving log message and log level from ResourceBundle > associated with log id's enum. > @see org.slf4j.i18n.impl.ResourceBundleLogLevelResolver > @see org.slf4j.i18n.impl.ResourceBundleMessageFormatResolver > > > For example: > ---- > Log Message Definition > ---- > public enum LogMessages { > > @Error("error message {}") // log level is bound to Error. > TEST0001, > > @Message("waring message {}") // log level is not specified. > TEST0002 > > } > > ---- > Logging > ---- > > public static void main(String[] args) { > I18NLogger logger = I18NLoggerFactory.getLogger(LogMain.class); > > // write to error log , because LogMessages.TEST0001 is bound to > Error level. > logger.log(LogMessages.TEST0001, "xxxx"); > logger.log(LogMessages.TEST0001, new NullPointerException()); > > // write log as error level. > logger.error(LogMessages.TEST0002, "xxxx"); > // write log as warn level. > logger.warn(LogMessages.TEST0002, new NullPointerException()); > } > > > Takeshi Kondo > > _______________________________________________ > dev mailing list > dev at slf4j.org > http://www.slf4j.org/mailman/listinfo/dev From takeshi.kondo at gmail.com Sun Aug 23 17:41:00 2009 From: takeshi.kondo at gmail.com (Takeshi Kondo) Date: Mon, 24 Aug 2009 00:41:00 +0900 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> Message-ID: <1B117E19-5992-40F0-AD10-C4A1BF108294@gmail.com> Ralph wrote: > I'm out of town on vacation right now so I might not get a chance to > review this for a couple of days. But I'd like to provide my > feedback before anything is incorporated. Your review is very helpful. Please review it when you'll get back form vacation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ceki at qos.ch Sun Aug 23 19:38:51 2009 From: ceki at qos.ch (Ceki Gulcu) Date: Sun, 23 Aug 2009 19:38:51 +0200 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <696A920C-B79E-4F21-BA13-784D34E8D023@gmail.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> <696A920C-B79E-4F21-BA13-784D34E8D023@gmail.com> Message-ID: <4A917EAB.6000608@qos.ch> Hello Takeshi, I have cloned your repo on my machine and tried to understand the code. Very nice work by the way! While I am starting to understand the possibilities offered by enums, I still do not completely understand how enums are more dynamic than resource bundles. If at one point in time you decide to modify the contents of a field in a LogMessage enum, you still need to compile the enum and redeploy the recompiled version. The enem field contains annotations, indicating the desired logging level. The level of a logging statement can thus be changed by changing the level annotation. However, you still need to recompile and redeploy the enum. In the existing logging paradigm, you would need to change the level of the logging statement by editing the java class containing the given logging statement and recompile, repackage and redeploy. Your approach may be a little more convenient (only one file needs to edited and compiled even if multiple levels needs to be changed). Are there are other advantages? Takeshi Kondo wrote: > > > I've developed initial thought of SLF4j's i18n extension. > It was committed to my branch > (http://github.com/takeshi/slf4j/tree/master). > > I've implemented 4 features as follows. > > 1. Logger interface using enum. > @see org.slf4j.i18n.I18NLogger > > 2. Extension point to bind log id's enum to log message and level. > @see org.slf4j.i18n.spi.LogLevelResolver > @see org.slf4j.i18n.spi.LogMessageFormatResolver > > 3. Resolving log message and log level from Annotation associated from > log id's enum. > @see org.slf4j.i18n.impl.AnnotationLogLevelResolver > @see org.slf4j.i18n.impl.AnnotationMessageFormatResolver > > 4. Resolving log message and log level from ResourceBundle associated > with log id's enum. > @see org.slf4j.i18n.impl.ResourceBundleLogLevelResolver > @see org.slf4j.i18n.impl.ResourceBundleMessageFormatResolver > > > For example: > ---- > Log Message Definition > ---- > public enum LogMessages { > > @Error("error message {}") // log level is bound to Error. > TEST0001, > > @Message("waring message {}") // log level is not specified. > TEST0002 > > } > > ---- > Logging > ---- > > public static void main(String[] args) { > I18NLogger logger = I18NLoggerFactory.getLogger(LogMain.class); > > // write to error log , because LogMessages.TEST0001 is bound to > Error level. > logger.log(LogMessages.TEST0001, "xxxx"); > logger.log(LogMessages.TEST0001, new NullPointerException()); > > // write log as error level. > logger.error(LogMessages.TEST0002, "xxxx"); > // write log as warn level. > logger.warn(LogMessages.TEST0002, new NullPointerException()); > } > > > Takeshi Kondo > -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch From takeshi.kondo at gmail.com Mon Aug 24 01:59:26 2009 From: takeshi.kondo at gmail.com (Takeshi Kondo) Date: Mon, 24 Aug 2009 08:59:26 +0900 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> Message-ID: <6AF0A254-D29E-436C-9C6A-3579A32E0217@gmail.com> Ceki wrote: > In the existing logging paradigm, you would need to change the level > of the logging statement by editing the java class containing the > given logging statement and recompile, repackage and redeploy. Your > approach may be a little more convenient (only one file needs to > edited and compiled even if multiple levels needs to be changed). > Are there are other advantages? When we want to change the log level and don't want to redeploy and repackage, we'll use way changing log level by ResourceBundle. Our operation is to add property file to system class path. It don't need recompiling and repackaging. ResourceBundle is higher order of precedence than Annotation about resolving log level and log message, so we can overwrite log level and log message by ResourceBundle. Annotation is for developent time with IDE support. Property file is for operation time with no recompiling and no repackaging. They are different use cases. And Message id management is trouble-filled,so this feature reduces it ,IMO. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rgoers at apache.org Mon Aug 24 06:56:26 2009 From: rgoers at apache.org (Ralph Goers) Date: Sun, 23 Aug 2009 21:56:26 -0700 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <696A920C-B79E-4F21-BA13-784D34E8D023@gmail.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> <696A920C-B79E-4F21-BA13-784D34E8D023@gmail.com> Message-ID: I found a few minutes to review the code this evening. There are several things I don't care for in this implementation: 1. While doable, plugging in new resolver implementations is kind of a pain. You have to create an I18NLogManager, create the custom resolvers and presumably new annotation resolvers, add them to the CompositeResolvers then add those to the manager. Finally a new I18nLoggerFactory has to be created taking the manager and setINSTANCE called. 2. The resolvers provide no mechanism for reloading the bundles if they are modified. Many environments want 24x7 up time and do not want to restart servers just to change message text. 3. The implementation only supports a single Locale - the default. 4. I dislike immensely having the log level in one property file and the message text in another. This is very error prone. If you want log levels then get rid of the property files and switch to using XML where the log level and message can be bound together. Of course, this runs the risk that the level might be different from one language to another. Another option - which makes far more sense to me - is to not even have a LogLevelResolver, just require the log level be defined in the enum and just use that. 5. Messages are always resolved in the writeLog method. This precludes the option of the message keys being written to a database so the message can be retrieved based on the user's locale or passing the message to different machines where it can be logged using a Locale appropriate for that environment. 6. If you really, really want to use ResourceBundle's then at least make Java 6 the minimum version and provide support for ResourceBundle.Control. However, since ResourceBundles don't provide support for reloading I'd avoid using them at all. 7. It seems very strange to have the LogLevel enum have log methods and that writeLog is actually calling them. 8. The callerData is going to be useless since the LogLevel enum is just using the standard SLF4J apis. Instead, the Logger needs to extend org.slf4j.ext.LoggerWrapper and actually log from that class. 9. The format of the LogMessages enum is: public enum LogMessages { @Error("error message {}") // The log level is bound to Error. TEST0001, @Message("waring message {}") // The log level is not specified. TEST0002 } a. why would you want to allow a log level to not be specified? (See item 4 above). It is now possible to not specify the level in the properties file and not specify it as an annotation. If that happens then the level will be info since that is what is hardcoded in I18NLoggerFactory. What is more annoying is that I can call logger.warn and generate an info level message. b. Other than showing that you know how to use annotations I don't see what the benefit is over doing something like: public enum LogMessages { private final LogLevel level; private final String message; public LogMessages(LogLevel lvl, String msg) { level = lvl; message = msg; } public LogLevel getLogLevel() { return level }; public String getMessage() { return message }; TEST0001(LogLevel.ERROR, "error message {}"); TEST0002(LogLevel.WARN, "warning message {}"}; } I only spent about an hour looking at this so this may not be the complete set of issues I might find. In short, this implementation is not very general purpose as it only supports a single use case. Ralph On Aug 22, 2009, at 10:32 PM, Takeshi Kondo wrote: > > > I've developed initial thought of SLF4j's i18n extension. > It was committed to my branch (http://github.com/takeshi/slf4j/tree/master > ). > > I've implemented 4 features as follows. > > 1. Logger interface using enum. > @see org.slf4j.i18n.I18NLogger > > 2. Extension point to bind log id's enum to log message and level. > @see org.slf4j.i18n.spi.LogLevelResolver > @see org.slf4j.i18n.spi.LogMessageFormatResolver > > 3. Resolving log message and log level from Annotation associated > from log id's enum. > @see org.slf4j.i18n.impl.AnnotationLogLevelResolver > @see org.slf4j.i18n.impl.AnnotationMessageFormatResolver > > 4. Resolving log message and log level from ResourceBundle > associated with log id's enum. > @see org.slf4j.i18n.impl.ResourceBundleLogLevelResolver > @see org.slf4j.i18n.impl.ResourceBundleMessageFormatResolver > > > For example: > ---- > Log Message Definition > ---- > public enum LogMessages { > > @Error("error message {}") // log level is bound to Error. > TEST0001, > > @Message("waring message {}") // log level is not specified. > TEST0002 > > } > > ---- > Logging > ---- > > public static void main(String[] args) { > I18NLogger logger = I18NLoggerFactory.getLogger(LogMain.class); > > // write to error log , because LogMessages.TEST0001 is bound to > Error level. > logger.log(LogMessages.TEST0001, "xxxx"); > logger.log(LogMessages.TEST0001, new NullPointerException()); > > // write log as error level. > logger.error(LogMessages.TEST0002, "xxxx"); > // write log as warn level. > logger.warn(LogMessages.TEST0002, new NullPointerException()); > } > > > Takeshi Kondo > > _______________________________________________ > dev mailing list > dev at slf4j.org > http://www.slf4j.org/mailman/listinfo/dev From git-noreply at pixie.qos.ch Mon Aug 24 14:36:53 2009 From: git-noreply at pixie.qos.ch (added by portage for gitosis-gentoo) Date: Mon, 24 Aug 2009 14:36:53 +0200 (CEST) Subject: [slf4j-dev] [GIT] SLF4J: Simple Logging Facade for Java branch, master, updated. 7a7cf32a3e2a9e5bdc4809f5c6a4e9cc0b120ee0 Message-ID: <20090824123654.4E93C2F8E3B@pixie.qos.ch> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SLF4J: Simple Logging Facade for Java". The branch, master has been updated via 7a7cf32a3e2a9e5bdc4809f5c6a4e9cc0b120ee0 (commit) from 859182efbae8cb22cf8de08c4a4421657576c16f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.qos.ch/gitweb/?p=slf4j.git;a=commit;h=7a7cf32a3e2a9e5bdc4809f5c6a4e9cc0b120ee0 http://github.com/ceki/slf4j/commit/7a7cf32a3e2a9e5bdc4809f5c6a4e9cc0b120ee0 commit 7a7cf32a3e2a9e5bdc4809f5c6a4e9cc0b120ee0 Author: Ceki Gulcu Date: Mon Aug 24 14:32:37 2009 +0200 - updated javadocs. Added blurb about the performance impact of JUL to SLF4J translation. Other indentation changes - edited legacy.html. Usage instructions for SLF4JBridgeHandler are found in the javadocs of SLF4JBridgeHandler. - updated .gitignore file diff --git a/jul-to-slf4j/src/test/java/org/slf4j/bridge/SLF4JBridgeHandlerPerfTest.java b/jul-to-slf4j/src/test/java/org/slf4j/bridge/SLF4JBridgeHandlerPerfTest.java new file mode 100644 index 0000000..0933696 --- /dev/null +++ b/jul-to-slf4j/src/test/java/org/slf4j/bridge/SLF4JBridgeHandlerPerfTest.java @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2004-2008 QOS.ch + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +package org.slf4j.bridge; + +import java.util.logging.Handler; +import java.util.logging.LogManager; + +import junit.framework.TestCase; + +import org.apache.log4j.FileAppender; +import org.apache.log4j.PatternLayout; +import org.slf4j.LoggerFactory; + +public class SLF4JBridgeHandlerPerfTest extends TestCase { + + static String LOGGER_NAME = "yay"; + static int RUN_LENGTH = 100*1000; + + FileAppender fileAppender; + org.apache.log4j.Logger log4jRoot; + java.util.logging.Logger julRootLogger = LogManager.getLogManager() + .getLogger(""); + + java.util.logging.Logger julLogger = java.util.logging.Logger + .getLogger(LOGGER_NAME); + org.slf4j.Logger slf4jLogger = LoggerFactory.getLogger(LOGGER_NAME); + + Handler[] existingHandlers; + + public SLF4JBridgeHandlerPerfTest(String arg0) { + super(arg0); + } + + protected void setUp() throws Exception { + super.setUp(); + fileAppender = new FileAppender(new PatternLayout("%r [%t] %p %c %x - %m%n"), "target/test-output/toto.log"); + + existingHandlers = julRootLogger.getHandlers(); + for (int i = 0; i < existingHandlers.length; i++) { + julRootLogger.removeHandler(existingHandlers[i]); + } + log4jRoot = org.apache.log4j.Logger.getRootLogger(); + log4jRoot.addAppender(fileAppender); + } + + protected void tearDown() throws Exception { + super.tearDown(); + SLF4JBridgeHandler.uninstall(); + fileAppender.close(); + log4jRoot.getLoggerRepository().resetConfiguration(); + for (int i = 0; i < existingHandlers.length; i++) { + julRootLogger.addHandler(existingHandlers[i]); + } + } + + double julLoggerLoop() { + long start = System.nanoTime(); + for (int i = 0; i < RUN_LENGTH; i++) { + julLogger.info("jul"); + } + long end = System.nanoTime(); + return (end - start) * 1.0 / RUN_LENGTH; + } + + double slf4jLoggerLoop() { + long start = System.nanoTime(); + for (int i = 0; i < RUN_LENGTH; i++) { + slf4jLogger.info("slf4j"); + } + long end = System.nanoTime(); + return (end - start) * 1.0 / RUN_LENGTH; + } + + public void testPerf() { + SLF4JBridgeHandler.install(); + //log4jRoot.setLevel(org.apache.log4j.Level.ERROR); + + julLoggerLoop(); + double julAvg=julLoggerLoop(); + System.out.println("Average cost per call (JUL->SLF4J->log4j):"+julAvg +" nanos"); + + slf4jLoggerLoop(); + double slf4jAvg=slf4jLoggerLoop(); + System.out.println("Average cost per call (SLF4J->log4j):"+slf4jAvg +" nanos"); + System.out.println("Ratio "+(julAvg/slf4jAvg)); + } +} ----------------------------------------------------------------------- Summary of changes: .../slf4j/bridge/SLF4JBridgeHandlerPerfTest.java | 109 ++++++++++++++++++++ 1 files changed, 109 insertions(+), 0 deletions(-) create mode 100644 jul-to-slf4j/src/test/java/org/slf4j/bridge/SLF4JBridgeHandlerPerfTest.java hooks/post-receive -- SLF4J: Simple Logging Facade for Java From git-noreply at pixie.qos.ch Mon Aug 24 14:40:09 2009 From: git-noreply at pixie.qos.ch (added by portage for gitosis-gentoo) Date: Mon, 24 Aug 2009 14:40:09 +0200 (CEST) Subject: [slf4j-dev] [GIT] SLF4J: Simple Logging Facade for Java branch, master, updated. a3c95b1a1d4bfc06442919e5a0108333738f5bbe Message-ID: <20090824124009.4E4A52F8E68@pixie.qos.ch> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SLF4J: Simple Logging Facade for Java". The branch, master has been updated via a3c95b1a1d4bfc06442919e5a0108333738f5bbe (commit) from 7a7cf32a3e2a9e5bdc4809f5c6a4e9cc0b120ee0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.qos.ch/gitweb/?p=slf4j.git;a=commit;h=a3c95b1a1d4bfc06442919e5a0108333738f5bbe http://github.com/ceki/slf4j/commit/a3c95b1a1d4bfc06442919e5a0108333738f5bbe commit a3c95b1a1d4bfc06442919e5a0108333738f5bbe Author: Ceki Gulcu Date: Mon Aug 24 14:37:50 2009 +0200 This commit completes commit 7a7cf32a3e2a9e5bdc4809f5c6a4e9cc0b120ee0 - updated javadocs. Added blurb about the performance impact of JUL to SLF4J translation. Other indentation changes - edited legacy.html. Usage instructions for SLF4JBridgeHandler are found in the javadocs of SLF4JBridgeHandler. - updated .gitignore file diff --git a/.gitignore b/.gitignore index a728ab3..9539fb5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,5 @@ -*~ +.settings +target +.classpath +.project +*~ \ No newline at end of file diff --git a/jul-to-slf4j/src/main/java/org/slf4j/bridge/SLF4JBridgeHandler.java b/jul-to-slf4j/src/main/java/org/slf4j/bridge/SLF4JBridgeHandler.java index 8618944..b065185 100644 --- a/jul-to-slf4j/src/main/java/org/slf4j/bridge/SLF4JBridgeHandler.java +++ b/jul-to-slf4j/src/main/java/org/slf4j/bridge/SLF4JBridgeHandler.java @@ -75,6 +75,19 @@ import org.slf4j.spi.LocationAwareLogger; * julLogger.fine("hello world"); // this will get redirected to SLF4J * * + *

    + * Please note that translating a java.util.logging event into SLF4J incurs the + * cost of constructing {@link LogRecord} instance regardless of whether the + * SLF4J logger is disabled for the given level. Consequently, j.u.l. to + * SLF4J translation can seriously impact on the cost of disabled logging + * statements (60 fold increase) and a measurable impact on enabled log + * statements (20% overall increase). + *

    + * + *

    + * If application performance is a concern, then use of SLF4JBridgeHandler is + * appropriate only if few j.u.l. logging statements are in play. + * * @author Christian Stein * @author Joern Huxhorn * @author Ceki Gülcü diff --git a/jul-to-slf4j/src/test/java/org/slf4j/bridge/SLF4JBridgeHandlerPerfTest.java b/jul-to-slf4j/src/test/java/org/slf4j/bridge/SLF4JBridgeHandlerPerfTest.java index 0933696..ae7d25c 100644 --- a/jul-to-slf4j/src/test/java/org/slf4j/bridge/SLF4JBridgeHandlerPerfTest.java +++ b/jul-to-slf4j/src/test/java/org/slf4j/bridge/SLF4JBridgeHandlerPerfTest.java @@ -38,6 +38,10 @@ public class SLF4JBridgeHandlerPerfTest extends TestCase { static String LOGGER_NAME = "yay"; static int RUN_LENGTH = 100*1000; + + // set to false to test enabled logging performance + boolean disabledLogger = true; + FileAppender fileAppender; org.apache.log4j.Logger log4jRoot; java.util.logging.Logger julRootLogger = LogManager.getLogManager() @@ -95,15 +99,17 @@ public class SLF4JBridgeHandlerPerfTest extends TestCase { public void testPerf() { SLF4JBridgeHandler.install(); - //log4jRoot.setLevel(org.apache.log4j.Level.ERROR); - + + if(disabledLogger) { + log4jRoot.setLevel(org.apache.log4j.Level.ERROR); + } julLoggerLoop(); double julAvg=julLoggerLoop(); - System.out.println("Average cost per call (JUL->SLF4J->log4j):"+julAvg +" nanos"); + System.out.println("Average cost per call (JUL->SLF4J->log4j): "+julAvg +" nanos"); slf4jLoggerLoop(); double slf4jAvg=slf4jLoggerLoop(); - System.out.println("Average cost per call (SLF4J->log4j):"+slf4jAvg +" nanos"); + System.out.println("Average cost per call (SLF4J->log4j): "+slf4jAvg +" nanos"); System.out.println("Ratio "+(julAvg/slf4jAvg)); } } diff --git a/slf4j-site/src/site/pages/legacy.html b/slf4j-site/src/site/pages/legacy.html index 327ab01..e729d82 100644 --- a/slf4j-site/src/site/pages/legacy.html +++ b/slf4j-site/src/site/pages/legacy.html @@ -193,14 +193,31 @@

    The jul-to-slf4j module includes a jul handler, namely SLF4JBridgeHandler, that routes all incoming jul records to the - SLF4j API. See also SLF4JBridgeHandler - javadocs. Contrary to other bridging modules such as - jcl-over-slf4j and log4j-over-slf4j, which re-implement JCL and - respectively log4j, the jul-to-slf4j modules does not re-implement - the java.util.logging package because packages under the java.* - namespace cannot be replaced. + javadocs for usage instructions.

    + +

    Contrary to other bridging modules such as jcl-over-slf4j and + log4j-over-slf4j, which re-implement JCL and respectively log4j, + the jul-to-slf4j modules does not re-implement the + java.util.logging package because packages under the java.* + namespace cannot be replaced. Instead, translates LogRecord into + their SLF4J equivalents. Please note that translating + java.util.logging events into SLF4J incurs the cost of + constructing LogRecord + instance regardless of whether the SLF4J logger is disabled for + the given level or nor. Consequently, j.u.l. to SLF4J translation + can seriously impact on the cost of disabled logging statements + (60 fold increase) and a measurable impact on enabled log + statements (20% overall increase). +

    + +

    If application performance is a concern, then use of + SLF4JBridgeHandler is appropriate only if few j.u.l. logging + statements are in play.

    +

    jul-to-slf4j.jar and slf4j-jdk14.jar cannot be present simultaneously @@ -213,7 +230,7 @@ route jul records to SLF4J. Thus, if both jar are present simultaneously (and SLF4JBridgeHandler is installed), slf4j calls will be delegated to jul and jul records will be routed to SLF4J, - resulting in an endless recursion. + resulting in an endless loop.

    ----------------------------------------------------------------------- Summary of changes: .gitignore | 6 +++- .../java/org/slf4j/bridge/SLF4JBridgeHandler.java | 13 ++++++++ .../slf4j/bridge/SLF4JBridgeHandlerPerfTest.java | 14 ++++++-- slf4j-site/src/site/pages/legacy.html | 31 +++++++++++++++---- 4 files changed, 52 insertions(+), 12 deletions(-) hooks/post-receive -- SLF4J: Simple Logging Facade for Java From ceki at qos.ch Mon Aug 24 15:15:07 2009 From: ceki at qos.ch (Ceki Gulcu) Date: Mon, 24 Aug 2009 15:15:07 +0200 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> <696A920C-B79E-4F21-BA13-784D34E8D023@gmail.com> Message-ID: <4A92925B.1050007@qos.ch> Takeshi's submission is not a finished product so let's go easy on him. While I have still not bought the idea of levels in enums or resource bundles, I think the idea of using enums for resource bundle keys is an important step forward. Having levels in the enum or resource bundles (I actually did not see that in the code) is conceptually interesting and possibly quite correct but it duplicates the data found in logging statements (=logger invocations in java code). Moreover, we could dynamically change the level of a logging statement based on rules placed in a configuration file. Here is an example of one such rule: if event has I18 marker if event.key == XYZ_10120 then event.level = ERROR; if event.key == XYZ_11234 then event.level = WARN; if event.key == XYZ_08173 then event.level = DEBUG; endif We would need to find a way to state the above in XML but that should not be a problem. (We would also need to add a mechanism for dynamically modifying a logging event after its creation.) FYI, I have created a small project for experimenting with the enum as resource bundles keys idea. You can see the result at http://git.qos.ch/ or on github http://github.com/ceki/i18n/tree/master Ralph Goers wrote: > I found a few minutes to review the code this evening. There are several > things I don't care for in this implementation: > 1. While doable, plugging in new resolver implementations is kind of a > pain. You have to create an I18NLogManager, create the custom resolvers > and presumably new annotation resolvers, add them to the > CompositeResolvers then add those to the manager. Finally a new > I18nLoggerFactory has to be created taking the manager and setINSTANCE > called. > 2. The resolvers provide no mechanism for reloading the bundles if they > are modified. Many environments want 24x7 up time and do not want to > restart servers just to change message text. > 3. The implementation only supports a single Locale - the default. > 4. I dislike immensely having the log level in one property file and the > message text in another. This is very error prone. If you want log > levels then get rid of the property files and switch to using XML where > the log level and message can be bound together. Of course, this runs > the risk that the level might be different from one language to another. > Another option - which makes far more sense to me - is to not even have > a LogLevelResolver, just require the log level be defined in the enum > and just use that. > 5. Messages are always resolved in the writeLog method. This precludes > the option of the message keys being written to a database so the > message can be retrieved based on the user's locale or passing the > message to different machines where it can be logged using a Locale > appropriate for that environment. > 6. If you really, really want to use ResourceBundle's then at least make > Java 6 the minimum version and provide support for > ResourceBundle.Control. However, since ResourceBundles don't provide > support for reloading I'd avoid using them at all. > 7. It seems very strange to have the LogLevel enum have log methods and > that writeLog is actually calling them. > 8. The callerData is going to be useless since the LogLevel enum is just > using the standard SLF4J apis. Instead, the Logger needs to extend > org.slf4j.ext.LoggerWrapper and actually log from that class. > 9. The format of the LogMessages enum is: > > public enum LogMessages { > > @Error("error message {}") // The log level is bound to Error. > TEST0001, > > @Message("waring message {}") // The log level is not specified. > TEST0002 > > } > > a. why would you want to allow a log level to not be specified? (See > item 4 above). It is now possible to not specify the level in the > properties file and not specify it as an annotation. If that happens > then the level will be info since that is what is hardcoded in > I18NLoggerFactory. What is more annoying is that I can call logger.warn > and generate an info level message. > b. Other than showing that you know how to use annotations I don't see > what the benefit is over doing something like: > > public enum LogMessages { > private final LogLevel level; > private final String message; > > public LogMessages(LogLevel lvl, String msg) { > level = lvl; > message = msg; > } > > public LogLevel getLogLevel() { return level }; > public String getMessage() { return message }; > > TEST0001(LogLevel.ERROR, "error message {}"); > TEST0002(LogLevel.WARN, "warning message {}"}; > > } > > I only spent about an hour looking at this so this may not be the > complete set of issues I might find. > > In short, this implementation is not very general purpose as it only > supports a single use case. > > Ralph > > > > On Aug 22, 2009, at 10:32 PM, Takeshi Kondo wrote: > >> >> >> I've developed initial thought of SLF4j's i18n extension. >> It was committed to my branch >> (http://github.com/takeshi/slf4j/tree/master). >> >> I've implemented 4 features as follows. >> >> 1. Logger interface using enum. >> @see org.slf4j.i18n.I18NLogger >> >> 2. Extension point to bind log id's enum to log message and level. >> @see org.slf4j.i18n.spi.LogLevelResolver >> @see org.slf4j.i18n.spi.LogMessageFormatResolver >> >> 3. Resolving log message and log level from Annotation associated from >> log id's enum. >> @see org.slf4j.i18n.impl.AnnotationLogLevelResolver >> @see org.slf4j.i18n.impl.AnnotationMessageFormatResolver >> >> 4. Resolving log message and log level from ResourceBundle associated >> with log id's enum. >> @see org.slf4j.i18n.impl.ResourceBundleLogLevelResolver >> @see org.slf4j.i18n.impl.ResourceBundleMessageFormatResolver >> >> >> For example: >> ---- >> Log Message Definition >> ---- >> public enum LogMessages { >> >> @Error("error message {}") // log level is bound to Error. >> TEST0001, >> >> @Message("waring message {}") // log level is not specified. >> TEST0002 >> >> } >> >> ---- >> Logging >> ---- >> >> public static void main(String[] args) { >> I18NLogger logger = I18NLoggerFactory.getLogger(LogMain.class); >> >> // write to error log , because LogMessages.TEST0001 is bound to >> Error level. >> logger.log(LogMessages.TEST0001, "xxxx"); >> logger.log(LogMessages.TEST0001, new NullPointerException()); >> >> // write log as error level. >> logger.error(LogMessages.TEST0002, "xxxx"); >> // write log as warn level. >> logger.warn(LogMessages.TEST0002, new NullPointerException()); >> } >> >> >> Takeshi Kondo >> >> _______________________________________________ >> dev mailing list >> dev at slf4j.org >> http://www.slf4j.org/mailman/listinfo/dev > > _______________________________________________ > dev mailing list > dev at slf4j.org > http://www.slf4j.org/mailman/listinfo/dev > -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch From takeshi.kondo at gmail.com Mon Aug 24 19:02:52 2009 From: takeshi.kondo at gmail.com (Takeshi Kondo) Date: Tue, 25 Aug 2009 02:02:52 +0900 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <6AF0A254-D29E-436C-9C6A-3579A32E0217@gmail.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> <6AF0A254-D29E-436C-9C6A-3579A32E0217@gmail.com> Message-ID: <42E1FC4F-DC3C-4355-84F7-8065AC14B893@gmail.com> Hello Ceki, I acknowledge that my first commit source code is not a finished product. It is draft. My job is together with WebBeans. My submission is one of resolutions that I have troubles using Seam. I want to finish off it as soon as possible. Please tell me reason that you can't understand it. I will all execute what I can do. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ceki at qos.ch Mon Aug 24 19:23:12 2009 From: ceki at qos.ch (Ceki Gulcu) Date: Mon, 24 Aug 2009 19:23:12 +0200 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <42E1FC4F-DC3C-4355-84F7-8065AC14B893@gmail.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> <6AF0A254-D29E-436C-9C6A-3579A32E0217@gmail.com> <42E1FC4F-DC3C-4355-84F7-8065AC14B893@gmail.com> Message-ID: <4A92CC80.4050204@qos.ch> Hi Takeshi, Thank you for your response. I have looked at your code again and now understand how levels can be set in resource bundles. Having said that, I am not convinced that associating levels to keys in resource bundles is a good idea because there are other possibly better ways of obtaining the same effect. This does not mean the idea is bad, it's just that it is not overwhelmingly convincing. Contrast this with your initial idea about linking message codes (aka messages keys or message codes) in enums with those found in resource bundles. Convinced that it has potential, I started a new project called cai18n to explore exactly this venue. See http://cai18n.qos.ch/ for details. You can get the code from http://github.com/ceki/cai18n/tree/master There is a lot to do in cai18n and everyone is welcome to participate. Takeshi Kondo wrote: > Hello Ceki, > > I acknowledge that my first commit source code is not a finished product. > It is draft. > > My job is together with WebBeans. My submission is one of resolutions > that I have troubles using Seam. > I want to finish off it as soon as possible. > > Please tell me reason that you can't understand it. > I will all execute what I can do. > -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch From takeshi.kondo at gmail.com Mon Aug 24 20:05:52 2009 From: takeshi.kondo at gmail.com (Takeshi Kondo) Date: Tue, 25 Aug 2009 03:05:52 +0900 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <42E1FC4F-DC3C-4355-84F7-8065AC14B893@gmail.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> <6AF0A254-D29E-436C-9C6A-3579A32E0217@gmail.com> <42E1FC4F-DC3C-4355-84F7-8065AC14B893@gmail.com> Message-ID: Hello Ceki Thanks for your response. Could you tell me reason you am not convinced? I don't understand that you have other possibly better ways of obtaining the change log level. From ceki at qos.ch Mon Aug 24 20:27:45 2009 From: ceki at qos.ch (Ceki Gulcu) Date: Mon, 24 Aug 2009 20:27:45 +0200 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> <6AF0A254-D29E-436C-9C6A-3579A32E0217@gmail.com> <42E1FC4F-DC3C-4355-84F7-8065AC14B893@gmail.com> Message-ID: <4A92DBA1.8050800@qos.ch> Takeshi Kondo wrote: > Hello Ceki > > Thanks for your response. > > Could you tell me reason you am not convinced? By not convinced, I mean that I am not persuaded by your approach but I am also not dismissing it. > I don't understand that you have other possibly better ways of > obtaining the change log level. You can use filters to create rules of action. Such filters can scan for message codes and when a particular message code is detected, the filter can modify the level associated with a logging statement. So, when you write logger.warn("The earth is warming up"); the filter can reduce the logging level to DEBUG instead of WARN on the fly. Filters can be defined in a configuration file which can be loaded and reloaded at will. So, filters are another way of changing the logging level at runtime. I hope this sheds some light on the matter. -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch From takeshi.kondo at gmail.com Mon Aug 24 21:36:51 2009 From: takeshi.kondo at gmail.com (Takeshi Kondo) Date: Tue, 25 Aug 2009 04:36:51 +0900 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <42E1FC4F-DC3C-4355-84F7-8065AC14B893@gmail.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> <6AF0A254-D29E-436C-9C6A-3579A32E0217@gmail.com> <42E1FC4F-DC3C-4355-84F7-8065AC14B893@gmail.com> Message-ID: <40954403-DA76-43CD-8111-62A054F30963@gmail.com> Hi Ceki I know filters. I'm heavy log4j user. In other times I discussed on Makers, I want to change log level to info from debug to analyze system crash. Your approach is event filtering and can't move up the log level. And if it is no need of log event, it is better to filter log event as soon as possible. The first filtering point is the point evaluating log level. I don't understand you don't introduce changing log event. Are there are another way of changing the logging level? Takeshi Kondo -------------- next part -------------- An HTML attachment was scrubbed... URL: From ceki at qos.ch Mon Aug 24 21:56:38 2009 From: ceki at qos.ch (Ceki Gulcu) Date: Mon, 24 Aug 2009 21:56:38 +0200 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <40954403-DA76-43CD-8111-62A054F30963@gmail.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> <6AF0A254-D29E-436C-9C6A-3579A32E0217@gmail.com> <42E1FC4F-DC3C-4355-84F7-8065AC14B893@gmail.com> <40954403-DA76-43CD-8111-62A054F30963@gmail.com> Message-ID: <4A92F076.9030205@qos.ch> Takeshi Kondo wrote: > Hi Ceki > > I know filters. I'm heavy log4j user. There are logging frameworks other than log4j. :-) > In other times I discussed on Makers, > I want to change log level to info from debug to analyze system crash. > Your approach is event filtering and can't move up the log level. The fact that it can't be done in log4j does not mean that it can't be done. > And if it is no need of log event, it is better to filter log event as > soon as possible. That really depends. As far as performance is concerned, the importance part is to perform internationalization only *after* the change of log level. > The first filtering point is the point evaluating log level. We could have different filtering points. > I don't understand you don't introduce changing log event. Because different alternatives need to be considered. Again, I am not dismissing you proposal. > Are there are another way of changing the logging level? See above and my previous message. > Takeshi Kondo -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch From takeshi.kondo at gmail.com Mon Aug 24 22:15:43 2009 From: takeshi.kondo at gmail.com (Takeshi Kondo) Date: Tue, 25 Aug 2009 05:15:43 +0900 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <40954403-DA76-43CD-8111-62A054F30963@gmail.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> <6AF0A254-D29E-436C-9C6A-3579A32E0217@gmail.com> <42E1FC4F-DC3C-4355-84F7-8065AC14B893@gmail.com> <40954403-DA76-43CD-8111-62A054F30963@gmail.com> Message-ID: <09B6907C-A19B-47AD-B21B-0820FBCCEBCC@gmail.com> Hi Ceki > The fact that it can't be done in log4j does not mean that it can't > be done. Is it mean that it can be done in logback? If it is, I'll change logger to logback. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ceki at qos.ch Mon Aug 24 22:25:09 2009 From: ceki at qos.ch (Ceki Gulcu) Date: Mon, 24 Aug 2009 22:25:09 +0200 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <09B6907C-A19B-47AD-B21B-0820FBCCEBCC@gmail.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> <6AF0A254-D29E-436C-9C6A-3579A32E0217@gmail.com> <42E1FC4F-DC3C-4355-84F7-8065AC14B893@gmail.com> <40954403-DA76-43CD-8111-62A054F30963@gmail.com> <09B6907C-A19B-47AD-B21B-0820FBCCEBCC@gmail.com> Message-ID: <4A92F725.5010204@qos.ch> Takeshi Kondo wrote: > Hi Ceki > > >> The fact that it can't be done in log4j does not mean that it can't be >> done. > > Is it mean that it can be done in logback? > > If it is, I'll change logger to logback. To be honest, at present time it can't be done in logback either. However, logback already has support for TurboFilters [1] which can already do arbitrary filtering. We'd need to enhance turbo filters so that they influence the contents of the logging event. My point is that the hook is already there, it needs to be enhanced. -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch From rgoers at apache.org Mon Aug 24 22:33:23 2009 From: rgoers at apache.org (Ralph Goers) Date: Mon, 24 Aug 2009 13:33:23 -0700 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <4A92F725.5010204@qos.ch> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> <6AF0A254-D29E-436C-9C6A-3579A32E0217@gmail.com> <42E1FC4F-DC3C-4355-84F7-8065AC14B893@gmail.com> <40954403-DA76-43CD-8111-62A054F30963@gmail.com> <09B6907C-A19B-47AD-B21B-0820FBCCEBCC@gmail.com> <4A92F725.5010204@qos.ch> Message-ID: <2B7CF7AA-EBA9-4E32-BA30-0573EDDCE2F2@apache.org> On Aug 24, 2009, at 1:25 PM, Ceki Gulcu wrote: > > > Takeshi Kondo wrote: >> Hi Ceki >>> The fact that it can't be done in log4j does not mean that it >>> can't be done. >> Is it mean that it can be done in logback? >> If it is, I'll change logger to logback. > > To be honest, at present time it can't be done in logback either. > However, logback already has support for TurboFilters [1] which can > already do arbitrary filtering. We'd need to enhance turbo filters > so that they influence the contents of the logging event. My point > is that the hook is already there, it needs to be enhanced. > What would need to be enhanced? Turbo Filters have access to the event and as far as I recall the event is not immutable. However, this becomes highly dependent on filters being run in the correct order. Ralph From takeshi.kondo at gmail.com Mon Aug 24 23:02:37 2009 From: takeshi.kondo at gmail.com (Takeshi Kondo) Date: Tue, 25 Aug 2009 06:02:37 +0900 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <09B6907C-A19B-47AD-B21B-0820FBCCEBCC@gmail.com> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> <6AF0A254-D29E-436C-9C6A-3579A32E0217@gmail.com> <42E1FC4F-DC3C-4355-84F7-8065AC14B893@gmail.com> <40954403-DA76-43CD-8111-62A054F30963@gmail.com> <09B6907C-A19B-47AD-B21B-0820FBCCEBCC@gmail.com> Message-ID: > > The fact that it can't be done in log4j does not mean that it can't > be done. > Is it mean that it can be done in logback? > > If it is, I'll change logger to logback. > To be honest, at present time it can't be done in logback either. > However, logback already has support for TurboFilters [1] which can > already do arbitrary filtering. We'd need to enhance turbo filters > so that they influence the contents of the logging event. My point > is that the hook is already there, it needs to be enhanced Thanks. I'm not wise about logging. I hope in your new project. I want you to resolve my concern in your new project. You will familiarize my idea than me. I've come up with it before two years. But I can't. It is interesting for me to discuss about logging with giant of logging. Thanks. Tkaeshi -------------- next part -------------- An HTML attachment was scrubbed... URL: From git-noreply at pixie.qos.ch Mon Aug 24 23:51:55 2009 From: git-noreply at pixie.qos.ch (added by portage for gitosis-gentoo) Date: Mon, 24 Aug 2009 23:51:55 +0200 (CEST) Subject: [slf4j-dev] [GIT] SLF4J: Simple Logging Facade for Java branch, master, updated. 1e3aadf8d8442882429ef5df53e0af455157d2ca Message-ID: <20090824215155.AF4B62F8DFA@pixie.qos.ch> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SLF4J: Simple Logging Facade for Java". The branch, master has been updated via 1e3aadf8d8442882429ef5df53e0af455157d2ca (commit) from a3c95b1a1d4bfc06442919e5a0108333738f5bbe (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.qos.ch/gitweb/?p=slf4j.git;a=commit;h=1e3aadf8d8442882429ef5df53e0af455157d2ca http://github.com/ceki/slf4j/commit/1e3aadf8d8442882429ef5df53e0af455157d2ca commit 1e3aadf8d8442882429ef5df53e0af455157d2ca Author: Ceki Gulcu Date: Mon Aug 24 23:46:55 2009 +0200 - Clarified the title in license.html. Previously the title said "SLF4J License" and some people thought that there was an SLF4J license instead of the actual MIT license - modified pom.xml to include licensing info Solves http://bugzilla.slf4j.org/show_bug.cgi?id=143 diff --git a/pom.xml b/pom.xml index 85c2b24..2a81ab7 100644 --- a/pom.xml +++ b/pom.xml @@ -18,6 +18,14 @@ 2005 + + + MIT License + http://www.opensource.org/licenses/mit-license.php + repo + + + diff --git a/slf4j-site/src/site/pages/license.html b/slf4j-site/src/site/pages/license.html index bde22a3..d482300 100644 --- a/slf4j-site/src/site/pages/license.html +++ b/slf4j-site/src/site/pages/license.html @@ -17,10 +17,10 @@
    -

    SLF4J License

    +

    Licensing terms for SLF4J

    SLF4J source code and binaries are distributed under the - following license. + MIT license.

    ----------------------------------------------------------------------- Summary of changes: pom.xml | 8 ++++++++ slf4j-site/src/site/pages/license.html | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) hooks/post-receive -- SLF4J: Simple Logging Facade for Java From bugzilla-daemon at pixie.qos.ch Mon Aug 24 23:52:56 2009 From: bugzilla-daemon at pixie.qos.ch (bugzilla-daemon at pixie.qos.ch) Date: Mon, 24 Aug 2009 23:52:56 +0200 (CEST) Subject: [slf4j-dev] [Bug 143] Include licensing information in pom.xml In-Reply-To: Message-ID: <20090824215256.742642F8E0D@pixie.qos.ch> http://bugzilla.slf4j.org/show_bug.cgi?id=143 Ceki Gulcu changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #6 from Ceki Gulcu 2009-08-24 23:52:55 --- Fixed commit 1e3aadf8d8442... See also http://git.qos.ch/gitweb/?p=slf4j.git;a=commit;h=1e3aadf8d84428824 -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. From ceki at qos.ch Tue Aug 25 10:32:29 2009 From: ceki at qos.ch (Ceki Gulcu) Date: Tue, 25 Aug 2009 10:32:29 +0200 Subject: [slf4j-dev] slf4j i8ln In-Reply-To: <2B7CF7AA-EBA9-4E32-BA30-0573EDDCE2F2@apache.org> References: <9BBBFA08-1465-42AC-82C1-28A65BDE4C8E@redhat.com> <4A8C41E9.6030908@qos.ch> <4D836248-FEC3-4278-BDCF-D8EBE1F212B5@gmail.com> <6AF0A254-D29E-436C-9C6A-3579A32E0217@gmail.com> <42E1FC4F-DC3C-4355-84F7-8065AC14B893@gmail.com> <40954403-DA76-43CD-8111-62A054F30963@gmail.com> <09B6907C-A19B-47AD-B21B-0820FBCCEBCC@gmail.com> <4A92F725.5010204@qos.ch> <2B7CF7AA-EBA9-4E32-BA30-0573EDDCE2F2@apache.org> Message-ID: <4A93A19D.6000207@qos.ch> Ralph Goers wrote: > > On Aug 24, 2009, at 1:25 PM, Ceki Gulcu wrote: > >> >> >> Takeshi Kondo wrote: >>> Hi Ceki >>>> The fact that it can't be done in log4j does not mean that it can't >>>> be done. >>> Is it mean that it can be done in logback? >>> If it is, I'll change logger to logback. >> >> To be honest, at present time it can't be done in logback either. >> However, logback already has support for TurboFilters [1] which can >> already do arbitrary filtering. We'd need to enhance turbo filters so >> that they influence the contents of the logging event. My point is >> that the hook is already there, it needs to be enhanced. >> > > > What would need to be enhanced? Turbo Filters have access to the event > and as far as I recall the event is not immutable. However, this becomes > highly dependent on filters being run in the correct order. At the time a turbo filter is called there is no event yet. The event is created after all the turbo filters are called (assuming none denied the request). As for immutability, most fields in a LoggingEvent are immutable. Yes, the down side of having many filters is that they depend on their order of execution. The same principle applies in networking which explains why network filters are so damn fragile. > Ralph -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch From ceki at qos.ch Fri Aug 28 15:04:37 2009 From: ceki at qos.ch (Ceki Gulcu) Date: Fri, 28 Aug 2009 15:04:37 +0200 Subject: [slf4j-dev] Announcing CAI18N version 0.2 Message-ID: <4A97D5E5.4050707@qos.ch> 28th of August 2009 - Release of CAI18N version 0.2 I am happy to announce the immediate availability of CAI18N version 0.2. Compiler Assisted Internationalization, abbreviated as CAI18N, is a java library for writing internationalized messages. CAI18N is spawn of SLF4J. The two-page manual should give you an idea of what CAI18N is all about. http://cai18n.qos.ch/manual.html You comments on the cai18n-user or cai18n-dev lists are most welcome, -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch From rgoers at apache.org Fri Aug 28 21:25:00 2009 From: rgoers at apache.org (Ralph Goers) Date: Fri, 28 Aug 2009 12:25:00 -0700 Subject: [slf4j-dev] Announcing CAI18N version 0.2 In-Reply-To: <4A97D5E5.4050707@qos.ch> References: <4A97D5E5.4050707@qos.ch> Message-ID: The JDK version in the compiler plugin needs to be set to 1.6. I'm getting a compile error in MessageIdVerifier. The default JVM on my machine is 1.5. I guess you don't have a mailing list yet for the project. Ralph On Aug 28, 2009, at 6:04 AM, Ceki Gulcu wrote: > 28th of August 2009 - Release of CAI18N version 0.2 > > I am happy to announce the immediate availability of CAI18N version > 0.2. Compiler Assisted Internationalization, abbreviated as CAI18N, is > a java library for writing internationalized messages. CAI18N is spawn > of SLF4J. > > The two-page manual should give you an idea of what CAI18N is all > about. > > http://cai18n.qos.ch/manual.html > > You comments on the cai18n-user or cai18n-dev lists are most welcome, > > -- > Ceki G?lc? > Logback: The reliable, generic, fast and flexible logging framework > for Java. > http://logback.qos.ch > _______________________________________________ > dev mailing list > dev at slf4j.org > http://www.slf4j.org/mailman/listinfo/dev From ceki at qos.ch Mon Aug 31 21:03:11 2009 From: ceki at qos.ch (Ceki Gulcu) Date: Mon, 31 Aug 2009 21:03:11 +0200 Subject: [slf4j-dev] Announcing CAI18N version 0.2 In-Reply-To: References: <4A97D5E5.4050707@qos.ch> Message-ID: <4A9C1E6F.6000300@qos.ch> Hi Ralph, Thanks for the info. It's not the version of the compiler output but the reference to a method introduced in JDK 1.6. The problem was fixed in the latest release. By the way, the project name has been changed to CAL10N, pronounced calin instead of cai18n which was hard to pronounce, although "Kalaitinnen" was suggested by Bertrand Delacretaz. Just to repeat, the new project is now called CAL10N ( http://cal10n.qos.ch/ ) and it does have announce, user and dev mailing lists. Cheers, Ralph Goers wrote: > The JDK version in the compiler plugin needs to be set to 1.6. I'm > getting a compile error in MessageIdVerifier. The default JVM on my > machine is 1.5. I guess you don't have a mailing list yet for the project. > > Ralph > > On Aug 28, 2009, at 6:04 AM, Ceki Gulcu wrote: > >> 28th of August 2009 - Release of CAI18N version 0.2 >> >> I am happy to announce the immediate availability of CAI18N version >> 0.2. Compiler Assisted Internationalization, abbreviated as CAI18N, is >> a java library for writing internationalized messages. CAI18N is spawn >> of SLF4J. >> >> The two-page manual should give you an idea of what CAI18N is all >> about. >> >> http://cai18n.qos.ch/manual.html >> >> You comments on the cai18n-user or cai18n-dev lists are most welcome, -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch