[logback-user] Problems with DBAppender / JNDI / JBoss 7 / OracleDB

Henning Diederichs grave1740 at googlemail.com
Mon Dec 19 16:31:39 CET 2011


Hi there,

I’m trying to log into Oracle database tables using DBAppender and
JNDIConnectionSource. I created the needed tables for logging as
mentioned in documentation. I want to use connection pooling and the
JNDI variant for getting the pool. Here’s my configuration:

-JBoss 7.0.2 (the complete one, not the web profile)
-Oracle DB 11g
-logback-classic 0.9.29 -ojdbc 11.2.0.2.0

I configured the following things:
In JBoss:
-A new module for Oracle JDBC drivers
-A new connection pool using Oracle JDBC drivers in the modules segment of JBoss
     In standalone.xml:
              <datasource jndi-name="java:/myLog"
pool-name="myLogPool" enabled="true" jta="true"
use-java-context="true" use-ccm="true">
                    <connection-url>
                        jdbc:oracle:thin:@127.0.0.1:1521:orcl
                    </connection-url>
                    <driver>
                        oracle
                    </driver>
                    <transaction-isolation>
                        TRANSACTION_READ_COMMITTED
                    </transaction-isolation>
                    <pool>
                        <prefill>
                            true
                        </prefill>
                        <use-strict-min>
                            false
                        </use-strict-min>
                        <flush-strategy>
                            FailingConnectionOnly
                        </flush-strategy>
                    </pool>
                    <security>
                        <user-name>
                            log
                        </user-name>
                        <password>
                            secretPassw0rd
                        </password>
                    </security>
                </datasource>
-logback-classic.jar and it's dependencies are being shipped with my .ear file.

In logback.xml:
...
<appender name="DBAppender" class="ch.qos.logback.classic.db.DBAppender">
         <connectionSource class="ch.qos.logback.core.db.JNDIConnectionSource">
                   <param name="jndiLocation" value="java:/myLog" />
         </connectionSource>
</appender>
...
<root>
         <appender-ref ref="DBAppender" />
</root>

I have also configured a RollingFileAppender and a ConsoleAppender.
They both work fine on my JBoss. In the server.log from JBoss you can
see that he successfully published my data source myLog under
java:/myLog. I can't see any problems occurring due to logging from
JBoss. No problems with logging via logback are mentioned. But when my
application starts logging, the entries are logged to console and the
file appender, but nothing is written to the database. I have a second
connection pool configured in JBoss for my application. That one is
working fine.

I can't figure out what the problem is.
Please help me.


Regards,

Henning


More information about the Logback-user mailing list