Cool. I'm almost done with a refactor to commons-logging. I will
post the patch soon.
And I totally agree on the sentiment of configuration vs. writing code
(I had to do the same thing as you) just to handle something like
logging.
On Apr 22, 2008, at 12:00 PM, Will Johnson wrote:
(putting on flame suit)
I'd be in favor seeing is how I spent a good bit of time 2 months ago
writing JUL handlers and log managers to forward log messages to our
logging
framework (log4j). Pretty much any alternative (Commons, Log4j,
SLF4J) is
better since all of them allow you to _configure_ your underlying
implementation (including JUL if that's what you're into). JUL on
the other
hand ~requires you to write code to switch logging implementations
or even
do basic things like rotate log files. SLF4J seems especially slim
and nice
these days but really anything is better than JUL.
If others are really serious about it, I'd be happy to help the
cause. It
should be a fairly quick refactor and we could leave the default
configured
logger as JUL via whatever framework we end up going with
- will
-----Original Message-----
From: Grant Ingersoll [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 22, 2008 11:48 AM
To: solr-dev@lucene.apache.org
Subject: Solr Logging
Anyone have good tips on working w/ java.util.logging (JUL)? For one,
the configuration seems to be per JVM, which isn't all that useful in
a webapp environment.
http://www.crazysquirrel.com/computing/java/logging.jspx
has some tips for Tomcat, but I am using Jetty. Not too mention, it
seems, that if one wants to implement their own Handler, they have to
somehow figure out how to get it in the right classloader, since the
JVM classloader can't seem to find it if it is packaged in a WAR.
I know logging is sometimes a religious debate, but would others
consider a patch that switched Solr to use log4j? Or, commons-
logging? I just don't think JUL is up to snuff when it comes to
logging. It's a PITA to configure, is not flexible, doesn't play nice
with other logging systems and, all in all, just seems like crappy
design by committee where the lowest common denominator won out.
The switch is quite painless, and the former offers a lot more
flexibility, while the latter allows one to plugin whatever they see
fit. I will work up a patch so people can at least see the options.
Cheers,
Grant
--------------------------
Grant Ingersoll
Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ