Hi, kind of weird problem here :oops: I will be very happy if this a kind of a newbie problem!
We are using a FileLogger in Tomcat to have our application log to it's own file. The file has a prefix, a suffix and a timestamp.
The weird thing in here is some INFO entries go to that file, but others are still in stdout.log. :shock:
We 'd included in our myapp.xml file a file logger definition:
Then, our log4j.properties file, in WEB-INF/classes has the standard settings for stdout.Code:<Context .... <Environment name="config/jdbcConfigLocation" some jndi stuff .. <Logger className="org.apache.catalina.logger.FileLogger" prefix="myapp_" suffix=".log" timestamp="true"/> </Context>
Now in the web.xml file we have the regularCode:log4j.rootLogger=INFO, stdout log4j.logger.com.acme.myapp=INFO
In our beans, we init the logger with a regularCode:<context-param> <param-name>log4jConfigLocation</param-name> <param-value>/WEB-INF/classes/log4j.properties</param-value> </context-param> <listener> <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> </listener>
Some of the problematic classes are not Spring beans, they are created at runtime. They also instantiate the logger using the standard call.Code:import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; Log logger = LogFactory.getLog(getClass());
Any help, or at least an aspirin would be appreciate!
Cheers,
Gustavo


Reply With Quote