struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Raible" <m...@raibledesigns.com>
Subject Log4J and Struts - using Chiki's log4j configuration and getting tons of messages
Date Tue, 12 Feb 2002 23:49:39 GMT
Hello,

I am trying to implement log4j in my application.  I'm using the Struts
nightly build.  If I don't have a log4j.properties file in my
WEB-INF/classes directory, I get the following error:

log4j:ERROR No appenders could be found for category
(org.apache.commons.digester).
log4j:ERROR Please initialize the log4j system properly.

I think this is being kicked off my one of the servlets in my web.xml
because I haven't even written any code yet, but I am using Validator,
Workflow and Tiles.  

So I copied the log4j.cfg file from Chiki's WEB-INF directory, renamed
and put in in its place.  Now I get more logging messages than I can
stand, and I have changed all the debug and detail values in web.xml to
0.  My log file on startup is over 1000 lines long.  

Does anyone have any idea how to configure this properly - or point me
towards a resource that does.  A simple "search the archives" is fine as
well.

Thanks,

Matt

Log4j.properties file:

log4j.rootCategory=debug, stdout, R

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%p [%t] [%c] %C{1}.%M(%L)
| %m%n

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=onpoint.log

log4j.appender.R.MaxFileSize=100KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n

log4j.category.Init=DEBUG
log4j.category.Config=DEBUG
log4j.category.Actions=DEBUG
log4j.category.Repository=DEBUG
log4j.category.Persister=DEBUG
log4j.category.Translator=DEBUG
log4j.category.Cache=DEBUG
log4j.category.Validator=DEBUG
log4j.category.Registry=DEBUG
log4j.category.Event=DEBUG

First few lines of my log file:

DEBUG main org.apache.commons.digester - Pop
org.apache.struts.action.ActionForward
DEBUG main org.apache.commons.digester - ignorableWhitespace(
		)
DEBUG main org.apache.commons.digester - endElement(,action,action)

Here are the servlets in my web.xml:

	<!-- Workflow Registry Servlet Configuration -->
	<servlet>
		<servlet-name>registry</servlet-name>
	
<servlet-class>com.onpoint.webapp.workflow.RegistryServlet</servlet-clas
s>
		<init-param>
			<param-name>registry</param-name>
			<param-value>/WEB-INF/workflow.xml</param-value>
		</init-param>
		<init-param>
			<param-name>debug</param-name>
			<param-value>999</param-value>
		</init-param>
		<init-param>
			<param-name>detail</param-name>
			<param-value>999</param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<!-- "Wizard" Activity Servlet Configuration -->
	<servlet>
		<servlet-name>wizard</servlet-name>
	
<servlet-class>org.apache.commons.workflow.web.ActivityServlet</servlet-
class>
		<init-param>
			<param-name>activity</param-name>
			<param-value>/WEB-INF/workflow.xml</param-value>
		</init-param>
		<init-param>
			<param-name>debug</param-name>
			<param-value>999</param-value>
		</init-param>
		<init-param>
			<param-name>detail</param-name>
			<param-value>999</param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<!-- Validator Initialization Servlet Configuration -->
	<servlet>
		<servlet-name>validator</servlet-name>
	
<servlet-class>com.wintecinc.struts.action.ValidatorServlet</servlet-cla
ss>
		<init-param>
			<param-name>config</param-name>
	
<param-value>/WEB-INF/validator.xml</param-value>
		</init-param>
		<init-param>
			<param-name>debug</param-name>
			<param-value>2</param-value>
		</init-param>
		<load-on-startup>2</load-on-startup>
	</servlet>
	<!-- Action Servlet Configuration -->
	<servlet>
		<servlet-name>action</servlet-name>
	
<servlet-class>org.apache.struts.tiles.ActionComponentServlet</servlet-c
lass>
		<init-param>
			<param-name>definitions-config</param-name>
	
<param-value>/WEB-INF/tiles-config.xml</param-value>
		</init-param>
		<init-param>
			<param-name>definitions-debug</param-name>
			<param-value>1</param-value>
		</init-param>
		<init-param>
	
<param-name>definitions-parser-details</param-name>
			<param-value>0</param-value>
		</init-param>
		<init-param>
	
<param-name>definitions-parser-validate</param-name>
			<param-value>true</param-value>
		</init-param>
		<init-param>
			<param-name>application</param-name>
			<param-value>ApplicationResources</param-value>
		</init-param>
		<init-param>
			<param-name>config</param-name>
	
<param-value>/WEB-INF/struts-config.xml</param-value>
		</init-param>
		<init-param>
			<param-name>debug</param-name>
			<param-value>2</param-value>
		</init-param>
		<init-param>
			<param-name>detail</param-name>
			<param-value>3</param-value>
		</init-param>
		<init-param>
			<param-name>validate</param-name>
			<param-value>true</param-value>
		</init-param>
		<load-on-startup>2</load-on-startup>
	</servlet>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message