Hi all,

Log4j has been around for more time and has more features available:
http://wiki.apache.org/logging-log4j/Log4jvsJDKLogging. But the core logging
APIs are very similar and, as Piyush said, using log4j brings in new issues.
IMHO, we should try to extend the JDK's logger instead of replacing it for
just one feature missing. Someone has done this effort for the SMTPAppender,
see references here:
http://www.onjava.com/pub/a//onjava/2004/09/29/smtp-logging.html
http://smtphandler.sourceforge.net/index.html

One could also use the Restlet's JavaMail client to reimplement this
SmtpHandler :) Also, the usage of commons-logging is now being discouraged:
http://www.qos.ch/logging/thinkAgain.jsp I think it was useful when
frameworks were supporting pre-JDK 1.4 environments, which is not the case
of Restlets. A more recent effort intends to bridge all logging mechanisms:
http://www.slf4j.org/ The are even proposing a successor to log4j called
LogBack.

Concerning Restlets, we use two types of logs: Context logs (for traces,
warnings and errors in the code) and Access logs (WWW logs). The second type
is similar to an IIS or Apache HTTP server log. For this purpose, I wrote a
custom formatter: com.noelios.restlet.util.LogFormatter (to be renamed to
AccessLogFormatter soon). Also, as Applications are managed by their
Containers, we shouldn't give them the possibilities to customize the
implementation of the engine directly. If something has to be extendable, it
should probably be done at the org.restlet.Container level.

Concerning the invalid XML, it looks like a bug to me too. If it hasn't been
done already you should file one against the JDK and maybe override/replace
the default java.util.logging.XMLFormatter using your own code.

If some are still not OK with the current design, please enter a RFE in our
issue tracker, we'll continue the discussion there:
http://restlet.tigris.org/issues/enter_bug.cgi

Best regards,
Jerome  

> -----Message d'origine-----
> De : Piyush Purang [mailto:[EMAIL PROTECTED] 
> Envoyé : vendredi 3 novembre 2006 10:31
> À : discuss@restlet.tigris.org
> Objet : Re: using log4j
> 
> My 2 cents: there was a JSR, 47 I think, apache was the only one who
> voted No in the final ballot .. sometimes being more flexible isn't
> good.. I'd vote for sticking with what comes with the JDK.. it reduces
> the version-clashes (classloader issues) that I have seen so often
> creep up when you try and deploy two applications using two different
> versions of the same logging framework... and things get even more
> complicated when the container itself uses yet another version!
> 
> 
> Dave,
> 
> No bug/change request filed on what you pointed at? If not then I'd
> say file one...

Reply via email to