|
From: Ryan J. M. <ry...@da...> - 2008-07-07 03:02:41
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Since we didn't have logging in RESTEasy I introduced the slf4j logging API to the project over the weekend. I have put the following wiki page up here to detail some of the changes: http://wiki.jboss.org/wiki/RESTEasyLogging Going forward, I'd like to see logging instead of System.out ;) Ryan- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) iD8DBQFIcYdHK/xjmUY6JwURAl9iAJ453Bq+zrfPUvsmUgO83CaCmJ/9/ACfTDGm 18+LjZ87CRYVgDJtkO5djKM= =hKND -----END PGP SIGNATURE----- |
|
From: Bill B. <bb...@re...> - 2008-07-07 14:01:16
|
-1 on slf4j. I'm so sick of these shitty logging frameworks and the dependency problems and bloat problems they create. Let's use JDK logging instead. Its good enough for what we want to do. Ryan J. McDonough wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Since we didn't have logging in RESTEasy I introduced the slf4j > logging API to the project over the weekend. I have put the following > wiki page up here to detail some of the changes: > > http://wiki.jboss.org/wiki/RESTEasyLogging > > Going forward, I'd like to see logging instead of System.out ;) > > Ryan- > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.7 (Darwin) > > iD8DBQFIcYdHK/xjmUY6JwURAl9iAJ453Bq+zrfPUvsmUgO83CaCmJ/9/ACfTDGm > 18+LjZ87CRYVgDJtkO5djKM= > =hKND > -----END PGP SIGNATURE----- > > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source project, > along with a healthy diet, reduces your potential for chronic lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-developers -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Ryan M. <ry...@da...> - 2008-07-07 17:56:09
|
I can see your point, but I do respectfully disagree. The idea behind it was to offer choice to end users on logging frameworks. I didn't want people to have to manage 2 different logging configurations just to get at the log messages from RESTEasy. If I'm using JBoss AS, I'm most likely going to be using log4j, but if I'm running stand alone, maybe JDK logging will be sufficient. I've also not been much of a fan of JDK logging since configuration is kind of a pain. I've used log4j frequently, but I don't want to impose that restriction onto anyone else, which was the reason behind slf4j. On a related note, from a framework debugging perspective, I'd like to be able to offer detailed information available to developers, much the same way Hibernate does it: http://www.redhat.com/docs/manuals/jboss/jboss-eap-4.2/doc/hibernate/Hibernate_Reference_Guide/Configuration-Logging.html and how it's done in JBoss AS: http://docs.jboss.org/process-guide/en/html/logging.html I'd like to be able to offer the same level of details going forward. This is what the LoggingCategories class. Ryan- On Mon, Jul 7, 2008 at 10:03 AM, Bill Burke <bb...@re...> wrote: > -1 on slf4j. I'm so sick of these shitty logging frameworks and the > dependency problems and bloat problems they create. Let's use JDK logging > instead. Its good enough for what we want to do. > > Ryan J. McDonough wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> Since we didn't have logging in RESTEasy I introduced the slf4j logging >> API to the project over the weekend. I have put the following wiki page up >> here to detail some of the changes: >> >> http://wiki.jboss.org/wiki/RESTEasyLogging >> >> Going forward, I'd like to see logging instead of System.out ;) >> >> Ryan- >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.7 (Darwin) >> >> iD8DBQFIcYdHK/xjmUY6JwURAl9iAJ453Bq+zrfPUvsmUgO83CaCmJ/9/ACfTDGm >> 18+LjZ87CRYVgDJtkO5djKM= >> =hKND >> -----END PGP SIGNATURE----- >> >> ------------------------------------------------------------------------- >> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! >> Studies have shown that voting for your favorite open source project, >> along with a healthy diet, reduces your potential for chronic lameness >> and boredom. Vote Now at http://www.sourceforge.net/community/cca08 >> _______________________________________________ >> Resteasy-developers mailing list >> Res...@li... >> https://lists.sourceforge.net/lists/listinfo/resteasy-developers >> > > -- > Bill Burke > JBoss, a division of Red Hat > http://bill.burkecentral.com > -- Ryan J. McDonough http://www.damnhandy.com |
|
From: Bill B. <bb...@re...> - 2008-07-08 12:32:27
|
FYI, JBoss does have a pluggable logging abstraction. Ryan McDonough wrote: > I can see your point, but I do respectfully disagree. The idea behind it > was to offer choice to end users on logging frameworks. I didn't want > people to have to manage 2 different logging configurations just to get > at the log messages from RESTEasy. If I'm using JBoss AS, I'm most > likely going to be using log4j, but if I'm running stand alone, maybe > JDK logging will be sufficient. I've also not been much of a fan of JDK > logging since configuration is kind of a pain. I've used log4j > frequently, but I don't want to impose that restriction onto anyone > else, which was the reason behind slf4j. > > > > On a related note, from a framework debugging perspective, I'd like to > be able to offer detailed information available to developers, much the > same way Hibernate does it: > > > > http://www.redhat.com/docs/manuals/jboss/jboss-eap-4.2/doc/hibernate/Hibernate_Reference_Guide/Configuration-Logging.html > > > > and how it's done in JBoss AS: > > > > http://docs.jboss.org/process-guide/en/html/logging.html > > > > I'd like to be able to offer the same level of details going forward. > This is what the LoggingCategories class. > > > > Ryan- > > > > On Mon, Jul 7, 2008 at 10:03 AM, Bill Burke <bb...@re... > <mailto:bb...@re...>> wrote: > > -1 on slf4j. I'm so sick of these shitty logging frameworks and the > dependency problems and bloat problems they create. Let's use JDK > logging instead. Its good enough for what we want to do. > > Ryan J. McDonough wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Since we didn't have logging in RESTEasy I introduced the slf4j > logging API to the project over the weekend. I have put the > following wiki page up here to detail some of the changes: > > http://wiki.jboss.org/wiki/RESTEasyLogging > > Going forward, I'd like to see logging instead of System.out ;) > > Ryan- > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.7 (Darwin) > > iD8DBQFIcYdHK/xjmUY6JwURAl9iAJ453Bq+zrfPUvsmUgO83CaCmJ/9/ACfTDGm > 18+LjZ87CRYVgDJtkO5djKM= > =hKND > -----END PGP SIGNATURE----- > > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source > project, > along with a healthy diet, reduces your potential for chronic > lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > <mailto:Res...@li...> > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > > -- > Bill Burke > JBoss, a division of Red Hat > http://bill.burkecentral.com <http://bill.burkecentral.com/> > > > > > -- > Ryan J. McDonough > http://www.damnhandy.com -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Ryan J. M. <ry...@da...> - 2008-07-08 12:43:11
|
I knew that ;) It has something similar to commons-logging. JBoss AS 5 includes a provider for slf4j so I felt it was a safe choice. I didn't want to get into making the decision of using log4j or jdk logging, but at least something that can provide logging details. My desire is to keep slf4j, drop log4j as a dependency (as Martin already did) and use JDK logging as the default. Developers are free to choose whatever framework suits them. Or can we use jboss-logging? I know you're not a fan of logging, but logging can work. The logging details from Hibernate have saved my ass a number of times because they provided enough detail of what is going on when. I'd like to be able to offer the same. Ryan- On Jul 8, 2008, at 8:34 AM, Bill Burke wrote: > FYI, JBoss does have a pluggable logging abstraction. > > Ryan McDonough wrote: >> I can see your point, but I do respectfully disagree. The idea >> behind it was to offer choice to end users on logging frameworks. I >> didn't want people to have to manage 2 different logging >> configurations just to get at the log messages from RESTEasy. If >> I'm using JBoss AS, I'm most likely going to be using log4j, but if >> I'm running stand alone, maybe JDK logging will be sufficient. I've >> also not been much of a fan of JDK logging since configuration is >> kind of a pain. I've used log4j frequently, but I don't want to >> impose that restriction onto anyone else, which was the reason >> behind slf4j. >> On a related note, from a framework debugging perspective, I'd like >> to be able to offer detailed information available to developers, >> much the same way Hibernate does it: >> http://www.redhat.com/docs/manuals/jboss/jboss-eap-4.2/doc/hibernate/Hibernate_Reference_Guide/Configuration-Logging.html >> and how it's done in JBoss AS: >> http://docs.jboss.org/process-guide/en/html/logging.html >> I'd like to be able to offer the same level of details going >> forward. This is what the LoggingCategories class. >> Ryan- >> On Mon, Jul 7, 2008 at 10:03 AM, Bill Burke <bb...@re... <mailto:bb...@re... >> >> wrote: >> -1 on slf4j. I'm so sick of these shitty logging frameworks and >> the >> dependency problems and bloat problems they create. Let's use JDK >> logging instead. Its good enough for what we want to do. >> Ryan J. McDonough wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> Since we didn't have logging in RESTEasy I introduced the >> slf4j >> logging API to the project over the weekend. I have put the >> following wiki page up here to detail some of the changes: >> http://wiki.jboss.org/wiki/RESTEasyLogging >> Going forward, I'd like to see logging instead of >> System.out ;) >> Ryan- >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.7 (Darwin) >> iD8DBQFIcYdHK/xjmUY6JwURAl9iAJ453Bq+zrfPUvsmUgO83CaCmJ/9/ >> ACfTDGm >> 18+LjZ87CRYVgDJtkO5djKM= >> =hKND >> -----END PGP SIGNATURE----- >> >> ------------------------------------------------------------------------- >> Sponsored by: SourceForge.net Community Choice Awards: VOTE >> NOW! >> Studies have shown that voting for your favorite open source >> project, >> along with a healthy diet, reduces your potential for chronic >> lameness >> and boredom. Vote Now at http://www.sourceforge.net/community/cca08 >> _______________________________________________ >> Resteasy-developers mailing list >> Res...@li... >> <mailto:Res...@li...> >> https://lists.sourceforge.net/lists/listinfo/resteasy-developers >> -- Bill Burke >> JBoss, a division of Red Hat >> http://bill.burkecentral.com <http://bill.burkecentral.com/> >> -- >> Ryan J. McDonough >> http://www.damnhandy.com > > -- > Bill Burke > JBoss, a division of Red Hat > http://bill.burkecentral.com |
|
From: Bill B. <bb...@re...> - 2008-07-08 12:51:19
|
Ryan J. McDonough wrote: > I know you're not a fan of logging, but logging can work. Yeah, I know...Users find it very useful (I personally do not) and whatever users want, users get... I don't know anything about slf4j, but if the backend is pluggable, I"m all for it. Thanks for putting this together. I wouldn't have done it and we needed it... -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Ryan J. M. <ry...@da...> - 2008-07-08 12:56:20
|
On Jul 8, 2008, at 8:53 AM, Bill Burke wrote: > > > Ryan J. McDonough wrote: >> I know you're not a fan of logging, but logging can work. > > Yeah, I know...Users find it very useful (I personally do not) and > whatever users want, users get... I don't know anything about > slf4j, but if the backend is pluggable, I"m all for it. Yes, it's pluggable and it has nicer syntax than any of the others, IMHO. > > > Thanks for putting this together. I wouldn't have done it and we > needed it... My pleasure. > > > -- > Bill Burke > JBoss, a division of Red Hat > http://bill.burkecentral.com |
|
From: Martin A. <sp...@ma...> - 2008-07-08 12:59:18
|
(posting from another thread)
On 8 Jul 2008, at 14:31, Ryan J. McDonough wrote:
>> Btw I also made sl4j-log4j dependency optional since I hate log4j
>> with
>> a passion, and depending on resteasy currently pulled that crud into
>> my project.
>
> But do you share the same hatred of slf4j? I agree we should not
> impose the log4j on any one, but I'm still partial to including
> slf4j so that a log4j or other provider is optional but RESTEasy
> logging details are written to the log of their choice. If folks
> just simply don't like the idea of slf4j, we can yank it, but then
> again I hate JDK logging and System.out with a passion ;) Thoughts?
I agree we want logging and no System.out. My criteria for good
logging is:
1) Needs to work out-of-the-box, no additional configuration, jars etc
etc. log4j fails on the remarkably irritating lack of reasonable
defaults (no logging out of the box). slf4j fails on requiring the
presence of an implementation jar (would be much better if it
defaulted to java.util.logging that could be overridden by dropping in
a jar).
2) Needs to be non-intrusive. I don't want to sprinkle the class files
with crud to get a logger in place. log4j does this nicely,
Logger.getLogger( MyClass.class ) is all I need + the import. slf4j
fails because of the factory pattern
LoggerFactory.getLogger( MyClass.class ) + two imports (same goes for
java.util.logging) - but then slf4j is a bit better than
java.util.logging since the following construct in java is truly
hideous:
if ( logger.isLoggable( Level.FINE ) ) {
logger.fine( "Blah blah" );
}
instead of
if ( logger.isDebugEnabled() ) {
logger.debug( "Blah blah" );
}
Bottom line is that I think all logging framework suck. In previous
projects I've always preferred just making a small wrapper class local
to the project. It defaults to using java.util.logging to satisfy the
out-of-the-box criteria. Generally only bigger projects really require
all their logging to conform, which means they can spend the effort
tweaking my wrapper to do what it needs to.
M
|
|
From: Ryan J. M. <ry...@da...> - 2008-07-08 13:11:39
|
On Jul 8, 2008, at 8:59 AM, Martin Algesten wrote:
>
> (posting from another thread)
>
> On 8 Jul 2008, at 14:31, Ryan J. McDonough wrote:
>
>>> Btw I also made sl4j-log4j dependency optional since I hate log4j
>>> with
>>> a passion, and depending on resteasy currently pulled that crud into
>>> my project.
>>
>> But do you share the same hatred of slf4j? I agree we should not
>> impose the log4j on any one, but I'm still partial to including
>> slf4j so that a log4j or other provider is optional but RESTEasy
>> logging details are written to the log of their choice. If folks
>> just simply don't like the idea of slf4j, we can yank it, but then
>> again I hate JDK logging and System.out with a passion ;) Thoughts?
>
> I agree we want logging and no System.out. My criteria for good
> logging is:
>
> 1) Needs to work out-of-the-box, no additional configuration, jars
> etc etc. log4j fails on the remarkably irritating lack of reasonable
> defaults (no logging out of the box). slf4j fails on requiring the
> presence of an implementation jar (would be much better if it
> defaulted to java.util.logging that could be overridden by dropping
> in a jar).
True, but the same can be said of JCL too.
>
>
> 2) Needs to be non-intrusive. I don't want to sprinkle the class
> files with crud to get a logger in place. log4j does this nicely,
> Logger.getLogger( MyClass.class ) is all I need + the import. slf4j
> fails because of the factory pattern
> LoggerFactory.getLogger( MyClass.class ) + two imports (same goes
> for java.util.logging) - but then slf4j is a bit better than
> java.util.logging since the following construct in java is truly
> hideous:
I can live with 2 import statements if it's easier to use.
> if ( logger.isLoggable( Level.FINE ) ) {
> logger.fine( "Blah blah" );
> }
>
> instead of
>
> if ( logger.isDebugEnabled() ) {
> logger.debug( "Blah blah" );
> }
Even better, slf4j supports parameterized messages such that:
logger.debug("The new entry is {}.", entry);
You don't need to check isDebugEnabled() as that is handled
internally. If debug is not enabled, the message will not be parsed.
> Bottom line is that I think all logging framework suck. In previous
> projects I've always preferred just making a small wrapper class
> local to the project. It defaults to using java.util.logging to
> satisfy the out-of-the-box criteria. Generally only bigger projects
> really require all their logging to conform, which means they can
> spend the effort tweaking my wrapper to do what it needs to.
>
They do all suck, but some suck less can do the job better than others.
> M
>
>
>
|
|
From: Martin A. <sp...@ma...> - 2008-07-08 13:22:37
|
On 8 Jul 2008, at 15:11, Ryan J. McDonough wrote:
>> 1) Needs to work out-of-the-box, no additional configuration, jars
>> etc etc. log4j fails on the remarkably irritating lack of
>> reasonable defaults (no logging out of the box). slf4j fails on
>> requiring the presence of an implementation jar (would be much
>> better if it defaulted to java.util.logging that could be
>> overridden by dropping in a jar).
>
> True, but the same can be said of JCL too.
Haven't looked at JCL, but I take your word for it :)
>> 2) Needs to be non-intrusive. I don't want to sprinkle the class
>> files with crud to get a logger in place. log4j does this nicely,
>> Logger.getLogger( MyClass.class ) is all I need + the import. slf4j
>> fails because of the factory pattern
>> LoggerFactory.getLogger( MyClass.class ) + two imports (same goes
>> for java.util.logging) - but then slf4j is a bit better than
>> java.util.logging since the following construct in java is truly
>> hideous:
>
> I can live with 2 import statements if it's easier to use.
I can live with 2 statements too - it just irritates me.
>> if ( logger.isLoggable( Level.FINE ) ) {
>> logger.fine( "Blah blah" );
>> }
>>
>> instead of
>>
>> if ( logger.isDebugEnabled() ) {
>> logger.debug( "Blah blah" );
>> }
>
> Even better, slf4j supports parameterized messages such that:
>
> logger.debug("The new entry is {}.", entry);
>
> You don't need to check isDebugEnabled() as that is handled
> internally. If debug is not enabled, the message will not be parsed.
Yeah, I like that, and in my wrappers I always implemented that myself
using java.text.MessageFormat. I guess my main concern with slf4j is
that to get it working out-of-the-box we need to hard link to one
implementation jar - and whichever we chose it's going to be the wrong
one for someone.
M
|