Try putting the Logger(Category) in your pattern layout (via %c), so you can see who is doing the logging. I am assuming that the message is coming from struts (or another component/jar that it relies on), which uses the jakarta logging/commons package(which in turn will use log4j if it available.) or log4j directly.



At 11:16 AM 11/20/2002 -0500, Venkat Reddy Valluri wrote:
Hi,
I tried to log messages using log4j1.2.7.jar in my application using struts,
Here is code ..
public class TestAction extends ActionBase {
static Category cat = Category.getInstance(TestAction.class.getName());
private ActionForward doGetInfo(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response
) throws IOException, ServletException
{
--------
--------------
-------------

PropertyConfigurator.configure("/tmp/log4j.properties");
cat.info("starting main");
-----------
--------
}
}

log4j.properties
-------------------
log4j.rootCategory=DEBUG, dest1
log4j.appender.dest1=org.apache.log4j.FileAppender
log4j.appender.dest1.layout=org.apache.log4j.PatternLayout
log4j.appender.dest1.layout.ConversionPattern=%d{dd/MM/yyyy HH:mm:ss,SSS} [%p] [%t] - %m%n
log4j.appender.dest1.File=/tmp/example.log
log4j.logger.org.apache=WARN

here is /tmp/example.log

20/11/2002 11:03:06,438 [INFO] [HttpProcessor[8080][3]] - starting main
20/11/2002 11:03:08,648 [DEBUG] [HttpProcessor[8080][3]] - Followup = null
20/11/2002 11:03:12,222 [DEBUG] [HttpProcessor[8080][3]] - Followup = null
20/11/2002 11:03:18,832 [DEBUG] [HttpProcessor[8080][3]] - Followup = null

Here I didn't understand why Iam getting this junk mesaage Followup=null


Any help greatly appreciated

Thks
--Venkat




--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
  donald h. larmee                               [EMAIL PROTECTED]
                                                                         804.301.UTOP
                         utopian software concepts, inc.
                                 www.utopiansoft.com
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to