struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Holzem <>
Subject Double log output from commons-logging with log4j
Date Thu, 19 Jun 2003 14:21:06 GMT
Hi folks,

I'm hunting for some time the cause, why I get double output lines from 

My LogonForm::execute looks similar to:

    public ActionForward execute(
        ActionMapping mapping,
        ActionForm form,
        HttpServletRequest request,
        HttpServletResponse response)
        throws Exception
        System.out.println("LogonAction::execute called");
        // Obtain username and password from web tier
        LogonForm logonForm = (LogonForm) form;
        String userid = logonForm.getUserid()
        Log log = LogFactory.getLog(this.getClass());
        if (log.isDebugEnabled())
            log.debug("User "+userid+" logged on");
        // Return success
        return (mapping.findForward(Constants.SUCCESS));

The output I get is:

  [DEBUG] org.apache.struts.action.RequestProcessor -   Creating new 
Action instance
  [DEBUG] org.apache.struts.action.RequestProcessor -   Creating new 
Action instance
  LogonAction::execute called
  [DEBUG] app.control.LogonAction - User A123456 logged on
  [DEBUG] app.control.LogonAction - User A123456 logged on

Since I get "LogonAction::execute called" only once I'm pretty sure that 
execute is only called once. I think it has probably to do with my or, but I really can't spot 
what I'm doing wrong:
  # Logger catogory (DEBUG < INFO < WARN < ERROR < FATAL)
  # Appender Console
  # Pattern: level, category, message
  log4j.appender.Console.layout.ConversionPattern=[%-5p] %c - %m

Both are stored in the WEB-INF/classes directory.

Can anybody give me a hint?

Thanks, Markus

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message