[logback-user] Logging to Oracle with DBAppender and connection pooling doesn't work
Morten Egelund Rasmussen
morten.egelund.rasmussen at gmail.com
Fri Oct 31 09:57:26 CET 2008
Hi again,
It works with logback 0.9.11 (we were using 0.9.9 before). No need to
implement our own DBAppender anymore.
Much faster logging than with single connections!
Best regards,
~Morten :-)
On Thu, Oct 30, 2008 at 12:17 PM, Ceki Gulcu <listid at qos.ch> wrote:
> Hello Morten,
>
> Could you please try using logback 0.9.11? It should be much more helpful in
> diagnosing the problems you are encountering.
>
> Morten Egelund Rasmussen wrote:
>>
>> Hi all,
>>
>> Does anybody have a working example on how to log to Oracle with a
>> connection pool on a Tomcat server?
>>
>> I have the following:
>>
>> In Tomcat's server.xml:
>>
>> <Resource name="jdbc/logger" auth="Container"
>> type="javax.sql.DataSource"
>> driverClassName="oracle.jdbc.OracleDriver"
>> url="foo"
>> username="foo" password="foobar"
>> maxActive="50" maxIdle="5" initialSize="10"
>> maxWait="-1" removeAbandoned="true"
>> validationQuery="select 1 from dual"/>
>>
>> In Tomcat's context.xml:
>>
>> <ResourceLink name="jdbc/logger"
>> global="jdbc/logger"
>> type="javax.sql.DataSource"/>
>>
>> I have defined the following Logback appenders:
>>
>> <appender name="db" class="myAppenderClass">
>> <connectionSource
>> class="ch.qos.logback.core.db.JNDIConnectionSource">
>> <param name="jndiLocation" value="java:comp/env/jdbc/logger" />
>> </connectionSource>
>> </appender>
>>
>> <appender name="db2" class="myAppenderClass">
>> <connectionSource
>> class="ch.qos.logback.core.db.DriverManagerConnectionSource">
>> <driverClass>oracle.jdbc.driver.OracleDriver</driverClass>
>> <url>foo</url>
>> <user>foo</user>
>> <password>foobar</password>
>> </connectionSource>
>> </appender>
>>
>> .....where "myAppenderClass" is an appender class as described here:
>> http://jira.qos.ch/browse/LBCORE-15
>>
>> Using the "db" appender gives nothing, but using the "db2" appender
>> gives lots of output. What am I missing?
>>
>> Any ideas?
>>
>> ~Morten :-/
>> _______________________________________________
>> Logback-user mailing list
>> Logback-user at qos.ch
>> http://qos.ch/mailman/listinfo/logback-user
>>
>
> --
> Ceki Gülcü
> Logback: The reliable, generic, fast and flexible logging framework for
> Java.
> http://logback.qos.ch
>
More information about the Logback-user
mailing list