RE: debugging in struts Solved
Hi, To share with you At last done. I had removed the commons-logging.jar which was wrong. Now I am getting the logs in my file from struts api. Thanks. /Ashwani Hariharan [EMAIL PROTECTED]To: [EMAIL PROTECTED] msoft.com cc: Subject: RE: debugging in struts 06/12/2003 06:26 PM Please respond to hariharan Ok I guess some tomcat expert needs to Ans. this one. Iam using Oracle 9iAS -Hari -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2003 3:26 PM To: [EMAIL PROTECTED] Subject: RE: debugging in struts hi, Thanks for this. I am doing the same way with slight difference. First is that I am using xml file log4j_config.xml instead of properties file. Second is that I am not initializing it in my servlet. I am doing this by setting the property -Dlog4.configuration=log4j_config.xml . in Tomcat Things are working fine when I give my own debugging statements , but the log from the struts api is going(what ever is coming ) is going to tomcat log instead of file specified by me in log4j_config.xml . I think Tomcat logging is clashing with mine. I just check at the list if somebody is doing on tomcat. Which server you are using ? Hariharan [EMAIL PROTECTED]To: [EMAIL PROTECTED] msoft.com cc: Subject: RE: debugging in struts 06/12/2003 12:30 PM Please respond to hariharan Sure , apart from the basic log4j setup i have done following things.. you need three things to do . make following entries in your web.xml file STEP-1 -- servlet servlet-namelog4j-init/servlet-name servlet-classcom.medicom.common.Log4jInit/servlet-class init-param param-namelog4j.properties/param-name param-valueWEB-INF/classes/log4j.properties/param-value /init-param load-on-startup1/load-on-startup /servlet STEP-2 - I have com.medicom.common.Log4jInit servlet you can change the package name if u want. here is the content of thse init servlet /* * Created on Jun 7, 2003 * * prototype for DMC using struts * dmc_prototype * $Id:$ */ package com.medicom.common; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.PropertyConfigurator; /** * @author Administrator * * To change the template for this generated type comment go to * WindowPreferencesJavaCode GenerationCode and Comments */ public class Log4jInit extends HttpServlet { public void init(){ String prefix = getServletContext().getRealPath(/); String file = getInitParameter(log4j.properties); if (file != null){ System.err.println(using log file + prefix + file); PropertyConfigurator.configure(prefix + file); } } public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { } public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { } } STEP-3 -- Here is the content of my log4j.properties file that I have saved under WEB-INF/classes directory of my orion server # Start of log4j.properties file # This defines the logging level for the rootLogger. It is not required # if you
Re: debugging in struts
hi, u have two init params(debug detail) defined in the web.xml which defines the debug and detail level of logging. these logs the file using log4j configuration i am not sure , if ur kind of detailed errors come here, try out by giving a high "detail" level servlet servlet-nameaction/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-namedebug/param-name param-value2/param-value /init-param init-param param-namedetail/param-name param-value1/param-value /init-param load-on-startup2/load-on-startup /servlet ---Original Message--- From: Struts Users Mailing List Date: Tuesday, June 10, 2003 12:30:22 PM To: Struts Users Mailing List Subject: debugging in struts hi,I am not talking of any debugging tools but is there any way in whichstruts api is more verbose. Like some configuration paramFor eg I was using html:errors / it was not printing any errors, eventhough validation framework was returning the errors. I found that thethe value of msg attribute for validator tag was wrong. But it was notgiving me any errors.How to detect such errors ?TIAAshwani IncrediMail - Email has finally evolved - Click Here
RE: debugging in struts
U can specify debug attribute in your web.xml as a init param to the ActionServlet. but i don;t how far it will work out.. if u could give the correct context then i can suggest some thing. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 12:18 PM To: Struts Users Mailing List Subject: debugging in struts hi, I am not talking of any debugging tools but is there any way in which struts api is more verbose. Like some configuration param For eg I was using html:errors / it was not printing any errors, even though validation framework was returning the errors. I found that the the value of msg attribute for validator tag was wrong. But it was not giving me any errors. How to detect such errors ? TIA Ashwani This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorised review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful. Visit us at http://www.cognizant.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: debugging in struts
Hi ashwin , Even I was looking for somethign like this, I wanted to check internal working of struts I have configured log4j with a configuration file and init servlet and I shoould tell you outcome was very good,, I get to see every thing srtuts does in my server console. download log4j and configure with struts -hari hi, I am not talking of any debugging tools but is there any way in which struts api is more verbose. Like some configuration param For eg I was using html:errors / it was not printing any errors, even though validation framework was returning the errors. I found that the the value of msg attribute for validator tag was wrong. But it was not giving me any errors. How to detect such errors ? TIA Ashwani - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: debugging with struts/tomcat/JBuilder
I have done it for a nightly build (struts 1.0). To debug within the struts classes you must include the struts src code and jar file. The src code is from the dist/struts/src/share directory if you download the nightly src distribution. I had problems if I had more than one web application using struts, because the location of the struts.jar file needs to be under the WEB-INF/lib directory. There is probably a better way, but I got it working so I was happy. Any more questions? Steve Dan Cancro wrote: Has anyone successfully debugged a struts 0.5 application running on Tomcat 3.2, with JBuilder 4 Foundation version? I'm able to start Tomcat from JBuilder in debug mode, but I don't know how to open a source file from my struts application and have it stop execution at my breakpoints. Thanks