aspose file tools*
The moose likes Other Open Source Projects and the fly likes log4j jdbcappender Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "log4j jdbcappender" Watch "log4j jdbcappender" New topic
Author

log4j jdbcappender

Sundar Raj
Greenhorn

Joined: Jul 03, 2004
Posts: 3
my log4j property files like this


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

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

<appender name="JDBC"
class="org.apache.log4j.jdbc.JDBCAppender">
<param name="driver" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
<param name="URL" value="jdbc:microsoft:sqlserver://PC3080618882:1433;DatabaseName=model;SelectMethod=cursor;"/>
<param name="User" value="sun"/>
<param name="password" value="moon"/>
<param name="sql" value="INSERT INTO test(log_date)VALUES ('%c')"/>
<param name="BufferSize" value="4000"/>
<!-- <param name="commit" value="Y"/>-->
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%p-%m%n"/>
</layout>
</appender>

<!-- Root debugger -->
<root>
<priority value="debug"/>
<appender-ref ref="JDBC"/>
</root>

</log4j:configuration>

when i was trying to start my weblogic 9.2 i got follwing errors

log4j:ERROR Failed to excute sql
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Line 1: Incorrect syntax near 'Loading'.
at com.microsoft.jdbc.base.BaseExceptions.createException(Ljava.lang.Str
ing;Ljava.lang.String;I)Ljava.sql.SQLException;(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Ljava.sql.SQLException;II[Ljava.lang.String;Ljava.lang.String;I)Ljava.sql.SQLException;(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken()V(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(BLcom.microsoft.jdbc.base.BaseWarnings Z(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSExecuteRequest.processReplyToken(
BLcom.microsoft.jdbc.base.BaseWarnings Z(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Lcom.microso
ft.jdbc.base.BaseWarnings V(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType
()I(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(I)V(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Z)V(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecute()V(Unknown Source
)
at com.microsoft.jdbc.base.BaseStatement.executeUpdateInternal()I(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeUpdate(Ljava.lang.String
I(Unknown Source)
at org.apache.log4j.jdbc.JDBCAppender.execute(JDBCAppender.java:163)
at org.apache.log4j.jdbc.JDBCAppender.flushBuffer(JDBCAppender.java:235)

at org.apache.log4j.jdbc.JDBCAppender.append(JDBCAppender.java:131)
at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:221)

at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders
(AppenderAttachableImpl.java:57)
at org.apache.log4j.Category.callAppenders(Category.java:187)
at org.apache.log4j.Category.forcedLog(Category.java:372)
at org.apache.log4j.Category.log(Category.java:864)
at org.apache.commons.logging.impl.Log4JLogger.trace(Log4JLogger.java:85
)
at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.
java:876)
at org.apache.commons.beanutils.BeanUtilsBean.populate(BeanUtilsBean.jav
a:811)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:298)
at org.apache.commons.digester.SetPropertiesRule.begin(SetPropertiesRule
.java:217)
at org.apache.commons.digester.Rule.begin(Rule.java:152)
at org.apache.commons.digester.Digester.startElement(Digester.java:1286)


please anybody can solve the probs let me know.

thank you
Sundar M
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: log4j jdbcappender