On Mon, Jul 14, 2008 at 1:52 PM, Peter Ledbrook <[EMAIL PROTECTED]> wrote: >> The most important implementation is JSecurityLogFactory - please look >> at the source code and you'll see how I do my graceful degredation >> check. That is really all there is to it, plus the one-liner methods >> of the respective Log implementations. > > This is what worries me. While eliminating dependencies on third-party > libraries is a worthy goal, the current implementation does not appear > to be devoid of potential class loader issues. In particular, I'm not > sure that slf4j-api.jar will be found if it is loaded by the same > classloader as jsecurity.jar, but not the context class loader or > system class loader. Gracefully degrading to JDK logging while SLF4J > is on the classpath somewhere isn't particularly helpful.
It will - see the ClassUtils implementation. It discovers the Class in the appropriate mechanism to ensure the context class loader is used first and then the system class loader if not found. This order of operations works in all environments thus far (JEE and non), and is the same way we do EhCache discovery. > > To be honest, I don't fully understand the class loading issues, but I > do know that JCL still has not resolved the problems despite knowing > about them. I also know that SLF4J eschews runtime resolution of > loggers. Are you really that sure that the JSecurity implementation is > not going to have problems? The biggest issue for me is that class > loader issues are *really* difficult to diagnose, so if people have > issues 6 months down the line, we'll probably decide it's a > configuration error on their part. That's if they report them rather > than simply dumping JSecurity. Yes, the JCL class loader problems are due to runtime resolution of *Log* instances based on the argument class, i.e. Log log = LogFactory.getLog( getClass() ); The code I checked in has nothing to do with how the log framework implementation acquires logs at runtime - just determines if a particular API can be used or not. Regards, Les
