[Bug 186] New: [patch] Enhanced SimpleLogger implementation

http://bugzilla.slf4j.org/show_bug.cgi?id=186 Summary: [patch] Enhanced SimpleLogger implementation Product: SLF4J Version: unspecified Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: Implementations AssignedTo: slf4j-dev@qos.ch ReportedBy: cedrik.lime@gmail.com Created an attachment (id=70) --> (http://bugzilla.slf4j.org/attachment.cgi?id=70) New implementation of SimpleLogger I recently had to enhance SimpleLogger by back-porting some functionalities of commons-logging's SimpleLog into it. Namely, I have added the following: * optional configuration file; if none found, you get the exact same set of features as the currently released SimpleLogger. * enable to log more than the info log level * enable to set different log levels for different Loggers * enable to show/hide thread name * very primitive log messages customisation (about the same as commons-logging) Once again, the new code is totally compatible in behaviour and output with the currently released SimpleLogger. I also made it so that current users of commons-logging can upgrade to SLF4J very easily. Finally, I made sure to keep SimpleLogger as simple as possible: we already have fully-fledged logging frameworks, let's not re-invent one! I think this new implementation would enhance the value of SLF4J, while keeping a perfect retro-compatibility with previous versions. -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=186 Dmitry Katsubo <dma_k@mail.ru> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dma_k@mail.ru --- Comment #1 from Dmitry Katsubo <dma_k@mail.ru> 2010-12-15 16:41:29 --- I vote for this bug. I miss the possibility to log on all levels in slf4j-simple. -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=186 --- Comment #2 from Erik Dick <erik.dick@balsol.com> 2010-12-16 06:52:15 --- Created an attachment (id=73) --> (http://bugzilla.slf4j.org/attachment.cgi?id=73) SimpleLogger Enhancement Alternative implementation proposal for SimpleLogger -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=186 Erik Dick <erik.dick@balsol.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |erik.dick@balsol.com --- Comment #3 from Erik Dick <erik.dick@balsol.com> 2010-12-16 07:02:22 --- I also vote for this kind of enhancement. I attached another SimpleLogger implementation proposal which I originally made some couple month back on the dev mail list (no comments so far). It is a more simple approach than the proposal made by Cedrik and does not deal with migration aspect from other logger facilities. Does not use a configuration file, but reads the log level setting from the environment. If not instructed otherwise via the environment variables, it behaves like the current implementation of SimpleLogger. Baseline for the proposal is also 1.6.1 I have also enhanced the test suite for the loggers with my initial proposal. Have to check if that fits to current 1.6.1 level as well and will post it if wanted. -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=186 Michael Rumpf <michael@rumpfonline.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michael@rumpfonline.de --- Comment #4 from Michael Rumpf <michael@rumpfonline.de> 2011-02-13 17:07:34 CET --- I also vote for this kind of bug. Without having the flexibility to turn on output for all log levels this simple logger is almost useless. I wanted to switch to the SLF4J API and in a first step I do not want to care about which logging implementation to use. But in order to get all logging statements printed I need to decide on an implementation or to change the logger.debug statements to logger.info temporarily. Neither of those decisions gets me started quickly with SLF4J. And if I still have the whole mess about "how do I configure logging so that I get the output in Maven Surefire, in Eclipse Launch configuration, in standalone Jetty, ..." then I can stick with Jave Util Logging API because it comes with the JDK. -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=186 Daniel Trebbien <dtrebbien@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dtrebbien@gmail.com -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=186 --- Comment #5 from Cédrik LIME <cedrik.lime@gmail.com> 2012-06-08 16:20:08 CEST --- FYI, I (at last!) submitted a GitHub pull request. Might make Ceki's life easier to integrate the patch. :-) -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=186 Ceki Gulcu <listid@qos.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |listid@qos.ch --- Comment #6 from Ceki Gulcu <listid@qos.ch> 2012-06-08 16:38:54 CEST --- If customization is necessary, why not pick up any of the other logging frameworks such as jul, log4j or logback? I am struggling to understand the motivation behind these enhancements to SimpleLogger. To be honest, I fail to see the use case. Would anyone care to enlighten me? -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=186 --- Comment #7 from Cédrik LIME <cedrik.lime@gmail.com> 2012-06-08 17:20:38 CEST --- Ceki, You are right, a full-fledge logging framework is the ultimate goal. That said, there are times (e.g. prototyping code that you may re-use or promote, hence the use of a logging API) when you simply want the logging output fast on the console without spending time and brain to configure a "heavy-weight" logging framework. This is exactly what motivated the creation of SimpleLogger in the first instance. But as it stands, SimpleLogger is a bit "rigid". A little bit of flexibility would be welcomed in order to rapidly, e.g. print debug statements from part of the code while debuging. This is what this patch does. This patch is small and simple. I do not want to morph SimpleLogger into a huge logging framework! There are no appenders, no message-event object, no filters, no nothing really. Only the possibility to easily (and fast!) configure at which level it should log. This is the little bit of flexibility that SimpleLogger lacks right now, and that patch makes it go from "nearly unusable in real world" to "perfect for its limited purpose". As an added bonus (the cherry on the cake), I made it so that people using commons-logging SimpleLog feel at home when switching to SLF4J SimpleLogger. This new implementation is 100% compatible with the previous one. If you don't want to fiddle with it, fine! you get the same exact behaviour as previously. The "extra power" is immediately there should you need/want it. Regards, Cédrik -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=186 --- Comment #8 from Ceki Gulcu <listid@qos.ch> 2012-06-08 17:32:41 CEST --- Hi Cedric, Thank you for your answer. Assuming your patch is incorporated, 1) would you be willing to write documentation for your enhancements? 2) Would you be willing to answer questions regarding SimpleLogger on bugzilla and the mailing lists? In short, how open are you to ensuring the maintenance of SimpleLogger? -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=186 --- Comment #9 from Cédrik LIME <cedrik.lime@gmail.com> 2012-06-08 17:47:49 CEST --- Hi Ceki, I have already written detailed JavaDoc documentation on the SimpleLogger class. Should I add a paragraph in the SLF4J manual too? As for supporting this code, I've been on the -dev mailing list for a few years. I can subscribe to the -user one too should you deem it appropriate. I have no problem giving support and maintaining SimpleLogger. I've been using SLF4J for years, and probably will for the following decade(s)! Thanks, Cédrik -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=186 Cédrik LIME <cedrik.lime@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #10 from Cédrik LIME <cedrik.lime@gmail.com> 2012-06-12 11:36:57 CEST --- Closing this bug (release of SLF4J 1.6.6) -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.
participants (2)
-
bugzilla-daemon@pixie.qos.ch
-
bugzilla-daemon@qos.ch