logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Stauffer <jstau...@spscommerce.com>
Subject RE: DBAppender cannot function without a connection source
Date Tue, 11 May 2004 18:27:39 GMT
I found the UrlConnectionSource documentation so I tried the following.  I
now get the errors below but the same IllegalStateException.

	<appender name="JDBC3" class="org.apache.log4j.db.DBAppender">
		<connectionSource
class="org.apache.log4j.jdbc.UrlConnectionSource">
			<param name="driver"
value="oracle.jdbc.driver.OracleDriver" />
			<param name="url"
value="jdbc:oracle:thin:@goofy:1521:dwebec" />
			<param name="username" value="jamess" /> 
			<param name="password" value="123" />
		</connectionSource>
	</appender>

log4j:ERROR Parsing error on line 112 and column -1
log4j:ERROR Element "appender" does not allow "connectionSource" here.
log4j:ERROR Parsing error on line 112 and column -1
log4j:ERROR Element type "connectionSource" is not declared.
log4j:ERROR Parsing error on line 112 and column -1
log4j:ERROR Attribute "class" is not declared for element
"connectionSource".
log4j:ERROR Could not create an Appender. Reported error follows.

James Stauffer


-----Original Message-----
From: James Stauffer [mailto:jstauffe@spscommerce.com] 
Sent: Tuesday, May 11, 2004 1:05 PM
To: 'log4j-user@jakarta.apache.org'
Subject: DBAppender cannot function without a connection source


I am trying out the new DBAppender but I apparently don't know how to
configure it.  Can someone provide an example?  I searched the code for
DBAppender and ConnectionSource to try to find examples but I couldn't find
any.  My config and error are below.

	<appender name="JDBC3" class="org.apache.log4j.db.DBAppender">
		<DEFANGED_param name="url"
value="jdbc:oracle:thin:@goofy:1521:dwebec" />
		<DEFANGED_param name="username" value="jamess" /> 
		<DEFANGED_param name="password" value="123" />
	</appender>

log4j:WARN No such property [url] in org.apache.log4j.db.DBAppender.
log4j:WARN No such property [username] in org.apache.log4j.db.DBAppender.
log4j:WARN No such property [password] in org.apache.log4j.db.DBAppender.
log4j:ERROR Could not create an Appender. Reported error follows.
java.lang.IllegalStateException: DBAppender cannot function without a
connection source
	at
org.apache.log4j.db.DBAppender.activateOptions(DBAppender.java:49)
	at
org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:228)
	at
org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java
:154)
	at
org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator
.java:169)
	at
org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigu
rator.java:514)
	at
org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:475)
	at
org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:876)
	at
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:768)
	at
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:717)
	at
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:685)
	at
org.apache.log4j.xml.XMLWatchdog.doOnChange(DOMConfigurator.java:915)
	at
org.apache.log4j.helpers.FileWatchdog.checkAndConfigure(FileWatchdog.java:80
)
	at
org.apache.log4j.helpers.FileWatchdog.<init>(FileWatchdog.java:49)
	at org.apache.log4j.xml.XMLWatchdog.<init>(DOMConfigurator.java:908)
	at
org.apache.log4j.xml.DOMConfigurator.configureAndWatch(DOMConfigurator.java:
675)
	at
org.apache.log4j.xml.DOMConfigurator.configureAndWatch(DOMConfigurator.java:
660)
...(my code)


James Stauffer

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