logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amandeep Midha" <Amandeep.Mi...@itsprojects.com>
Subject PLease
Date Fri, 24 Jan 2003 20:45:10 GMT



hi,

thanks for your code. I tried the code, but i am getting following
exception

what should i do. I have classes12/classes12_g in classpath.

regards,
Amandeep


log4j:ERROR Failed to load driver
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1307)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1156)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:140)
        at
org.apache.log4j.jdbc.JDBCAppender.setDriver(JDBCAppender.java:332)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.log4j.config.PropertySetter.setProperty(PropertySetter.java:196)
        at
org.apache.log4j.config.PropertySetter.setProperty(PropertySetter.java:155)
        at
org.apache.log4j.xml.DOMConfigurator.setParameter(DOMConfigurator.java:530)
        at
org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:182)
        at
org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:140)
        at
org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:153)
        at
org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:201)
        at
org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:140)
        at
org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:153)
        at
org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:415)
        at
org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:384)
        at
org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:790)
        at
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:673)
        at
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:616)
        at
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:584)
        at
org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:694)





                                                                                         
                          
                    "Rich Bagley"                                                        
                          
                    <rbagley@hbs.e       To:     "Log4J Users List" <log4j-user@jakarta.apache.org>
                
                    du>                  cc:                                          
                             
                                         Subject:     RE: Please                         
                          
                    01/25/2003                                                           
                          
                    01:45 AM                                                             
                          
                    Please respond                                                       
                          
                    to "Log4J                                                            
                          
                    Users List"                                                          
                          
                                                                                         
                          
                                                                                         
                          




This works in log4j.1.2.7

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

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

    <appender name="jdbcAppender"
class="org.apache.log4j.jdbc.JDBCAppender">
        <param name="URL" value="jdbc:oracle:thin:@sd1.hbs.edu:1521:sc1" />
        <param name="Driver" value="oracle.jdbc.driver.OracleDriver" />
        <param name="User" value="user" />
        <param name="Password" value="password" />
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern"
                value="INSERT INTO LOGGING_SAMPLES_TEST (log_date,
log_level, location, message) VALUES ( '%d{ISO8601}','%p', '%C;%L', '%m' )"
/>
        </layout>
    </appender>

    <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern"
                value="%d{ISO8601} %p (%C;%L) %m%n"/>
        </layout>
    </appender>

    <logger name="logging.simple.jdbcLogger">
        <level value="debug"/>
        <appender-ref ref="jdbcAppender"/>
    </logger>

    <root>
        <priority value="error"/>
        <appender-ref ref="STDOUT"/>
    </root>

</log4j:configuration>

>> -----Original Message-----
>> From: Amandeep Midha [mailto:Amandeep.Midha@itsprojects.com]
>> Sent: Friday, January 24, 2003 3:04 PM
>> To: log4j-user@jakarta.apache.org
>> Subject: Please
>>
>>
>>
>> Can you send me sample xml to configure JDBC appender?
>>
>> thanks in advance
>>
>> regards,
>> Amandeep
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <mailto:log4j-user-unsubscribe@jakarta.apache.org>
>> For additional commands, e-mail:
>> <mailto:log4j-user-help@jakarta.apache.org>
>>


--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org
>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org
>






--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


Mime
View raw message