You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by ysuneelreddy <sr...@smarteinc.com> on 2006/07/27 09:51:22 UTC

Confugure DBAppender with Log4j....shows errors

Hi

This is suneel

Iam facing problems with DBAppender configuration.

We r using Log4j-1.3alpha-8..MySQL.

 

I wrote log4j.xml like this.

 

 

<log4j:configuration debug="true"
xmlns:log4j='http://jakarta.apache.org/log4j/'> 

    <appender  name="DB" class="org.apache.log4j.db.DBAppender"> 

        <connectionSource
class="org.apache.log4j.db.DriverManagerConnectionSource"> 

            <param name="driverClass" value="com.mysql.jdbc.Driver" /> 

            <param name="url"
value="jdbc:mysql://192.168.1.225:3306/smartedb" /> 

            <param name="user" value="smarte2"/>

            <param name="Password" value="smarte911"/>

         </connectionSource> 

    </appender>

</log4j:configuration>

 

It shows some thing like.

 

log4j:INFO Using URL [file:/C:/Program
Files/netbeans-4.1/enterprise1/jakarta-tomcat-5.5.7/common/classes/log4j.xml
] for automatic log4j configuration of repository named [default].

LOG4J-INTERNAL: 2006-07-27 13:05:41,515 DEBUG [main]
org.apache.log4j.joran.action.ConfigurationAction#begin:42)- Starting
internal logs on console.

LOG4J-INTERNAL: 2006-07-27 13:05:41,547 DEBUG [main]
org.apache.log4j.joran.action.AppenderAction#begin:52)- About to instantiate
appender of type [org.apache.log4j.db.DBAppender]

LOG4J-INTERNAL: 2006-07-27 13:05:41,593 DEBUG [main]
org.apache.log4j.joran.action.AppenderAction#begin:67)- Appender named as
[DB]

LOG4J-INTERNAL: 2006-07-27 13:05:41,593 DEBUG [main]
org.apache.log4j.joran.action.AppenderAction#begin:78)- Pushing appender on
to the object stack.

LOG4J-INTERNAL: 2006-07-27 13:05:41,672 DEBUG [main]
org.apache.log4j.joran.action.ParamAction#begin:61)- In ParamAction setting
parameter [driverClass] to value [com.mysql.jdbc.Driver].

LOG4J-INTERNAL: 2006-07-27 13:05:41,687 DEBUG [main]
org.apache.log4j.joran.action.ParamAction#begin:61)- In ParamAction setting
parameter [url] to value [jdbc:mysql://192.168.1.225:3306/smartedb].

LOG4J-INTERNAL: 2006-07-27 13:05:41,687 DEBUG [main]
org.apache.log4j.joran.action.ParamAction#begin:61)- In ParamAction setting
parameter [user] to value [smarte2].

LOG4J-INTERNAL: 2006-07-27 13:05:41,734 DEBUG [main]
org.apache.log4j.joran.action.ParamAction#begin:61)- In ParamAction setting
parameter [Password] to value [smarte911].

LOG4J-INTERNAL: 2006-07-27 13:05:42,890 DEBUG [main]
org.apache.log4j.db.DBAppender#setConnectionSource:199)- setConnectionSource
called for DBAppender

LOG4J-INTERNAL: 2006-07-27 13:05:42,890 DEBUG [main]
org.apache.log4j.db.DBAppender#activateOptions:164)-
DBAppender.activateOptions called

LOG4J-INTERNAL: 2006-07-27 13:05:42,890 DEBUG [main]
org.apache.log4j.joran.action.AppenderAction#end:110)- Popping appender
named [DB] from the object stack

LOG4J-INTERNAL: 2006-07-27 13:05:42,890 DEBUG [main]
org.apache.log4j.joran.action.ConfigurationAction#end:49)- Will stop writing
internal logs on console.

 

After it shows Failed to start server bundled Tomacat(5.5.7)

 

 

What id the dialect.how can I write it in MySQL.

Plz send me any piece of code or steps how to configure Log4j with
DBAppender..

 

 

 

Thanks & Rgds,

 

Yaramaka SuneelReddy.

Software Engineer,

Smarte Solutions,

ph : + 91 9833022044