log4j - not logging anything

I'm trying to use log4j in a web application, but I'm kinda new to it so I probably made some stupid mistake somewhere. So I put the commons-logging and log4j jars in my WEB-INF/lib, and I put the following log4j.properties in my WEB-INF/classes:

log4j.rootLogger=ERROR, A1

log4j.logger.vermillion.web.struts.action=DEBUG, A

log4j.appender.A1=org.apache.log4j.ConsoleAppender

log4j.appender.A1.layout=org.apache.log4j.PatternLayout

# Print the date in ISO 8601 format

log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

log4j.appender.A=org.apache.log4j.FileAppender

log4j.appender.A.File=/opt/apache-tomcat-5.5.23/logs/vermillion.log

log4j.appender.A.layout=org.apache.log4j.PatternLayout

log4j.appender.A.layout.ConversionPattern=%d{MM-dd@HH:mm:ss} %-5p (%13F:%L) %3x - %m%n

My struts application is set up so that there is one central class (called "VermillionSupport" - it extends ActionSupport), which is in turn extended by several action classes. The central class does not have an execute() method; that's saved for the separate classes. All these classes are in the package vermillion.web.struts.action

In the central class, I initialize the logger like this (outside of any methods, so it should be initialized when struts instantiates the class):

protectedstatic Logger log = Logger.getLogger(VermillionSupport.class);

In the execute method of one of the sub-classes, I have the following code:

Login user = findUser(getTemp_login().getUsername(), getTemp_login().getPassword());

log.fatal("pie");

System.out.println("pie");

I'm 95% sure this code is getting executed - I have the following action mapping in my struts config file:

<action name="Login_*" method="{1}" class="vermillion.web.struts.action.LoginAction">

<result name="input">/Login.jsp</result>

<result name="cancel" type="redirect-action">Welcome</result>

<result type="redirect-action">MainMenu</result>

<result name="expired" type="chain">ChangePassword</result>

<exception-mapping

exception="vermillion.dao.ExpiredPasswordException"

result="expired"/>

<interceptor-ref name="guest"/>

</action>

and loading the page Login_input.do does indeed return /Login.jsp, as expected.

The file /opt/apache-tomcat-5.5.23/logs/vermillion.log does indeed get created...but nothing gets logged. Either there, or in catalina.out. I'm baffled.

Can anyone figure out what's going on?

[3098 byte] By [leptogenesisa] at [2007-11-27 5:43:29]
# 1

omfg...I figured it out. Login_input.do and Login.do both return login.jsp...but Login_execute.do returns an internal server error, saying that nothing's mapped to a result of "error" from the LoginAction action. So I go in and add one - just adding in the line

<result name="error">Error.jsp</result>

to my struts config file. Now Login.do returns Error.jsp! Apparently what was happening was my code was erroring out before it got to a log statement...but rather than display the thrown exception, tomcat displays the Login.jsp page...I guess because the names have the same prefix? Why on earth did the struts developers think this was the proper behavior?!?

leptogenesisa at 2007-7-12 15:23:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
http://www.catb.org/~esr/faqs/smart-questions.html#forum http://logging.apache.org/site/mailing-lists.html
appy77a at 2007-7-12 15:23:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...