Hi Sumit,

You need to use a parent Application instead of a raw Restlet. You can
disable logging using Application.getLogService().setEnabled(false) but it
is enabled by default.

Please have a look at the updated tutorial:
http://www.restlet.org/tutorial#part07 and at
http://java.sun.com/j2se/1.5.0/docs/guide/logging/index.html

Best regards,
Jerome  

> -----Message d'origine-----
> De : news [mailto:[EMAIL PROTECTED] De la part de Sumit Lohia
> Envoyé : jeudi 2 novembre 2006 02:40
> À : [email protected]
> Objet : Re: using log4j
> 
> Jerome Louvel <contact <at> noelios.com> writes:
> > 
> > 
> > Hi Sumit,
> > 
> > If you are not used to the new JDK's logging feature, I would first
> > recommend to try using it. It is very powerful. 
> > 
> > Otherwise, you can still use log4j by modifying the NRE's 
> implementation:
> >  - Download and use the latest snapshot of beta 20 or the trunk
> >  - Create a subclass of 
> com.noelios.restlet.filter.LogFilter or a fresh
> > subclass of org.restlet.Filter that works with Log4j
> >  - Create a subclass of ApplicationHelper
> >  - Override ApplicationHelper.createLogFilter() method to 
> return your custom
> > logger
> >  - Create a subclass of com.noelios.restlet.Factory
> >  - Override the FactorycreateHelper(Application, Context) 
> method to return
> > your custom helper
> >  - Change the META-INF/services/org.restlet.spi.Factory 
> file to point to
> > your subclass of Factory
> > 
> > Let me know how it goes.
> > 
> > Best regards,
> > Jerome  
> 
> Hey Jerome,
> 
> Thanks for your response. I might have to try this out. In 
> the meantime, how do
> I enable "access logging" in a hello world restlet?
> 
> Sorry, if I'm asking very basic questions, but I'm trying to 
> go through the
> tutorial but haven't been able to set up logging at all yet.
> 
> Thanks.
> 
> Sumit
> 

Reply via email to