[logback-user] Logging to Oracle with DBAppender and connection pooling doesn't work
Ceki Gulcu
listid at qos.ch
Thu Oct 30 12:17:56 CET 2008
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