Jetty and log4j, no logs generated

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Jetty and log4j, no logs generated


Pardon me for asking the oft repeated question. I would like to know what I should do to make Jetty 2.2.22 use log4j. I searched in Google and I finally found Gmane. I couldn't get much info though. After reading various threads,(esp, I did the following:
1) Made a copy of log4j.jar under $JETTY_HOME/ext directory.
2) Created a file under $JETTY_HOME/etc directory.
3) Commented out lines related to logging in $JETTY_HOME/etc/jetty.xml
4) Started Jetty as
java -jar -org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger -Dlog4j.configuration=etc/ start.jar etc/jetty.xml

I still don't get the logs. Jetty just throws out the lines on console. What am I missing? I don't get "log4j:WARN No appenders could be found for logger" error message.

If I instantiate the logger in my JSP page and log, then the logs are getting created like
" Logger logger = Logger.getLogger("name");
  logger.debug(msg); "

Now I want to know if this is the only way to make Jetty use log4j(I hope not...) If this is indeed the case, what about request logs? How will I make Jetty log the requests using log4j?

Thank you for the patience. Any pointers will be highly appreciated. Thank you once again.