1 Reply Latest reply on Apr 26, 2016 12:49 PM by prabhu.padala

    Jdbcappender is not working in fuse esb 6.1

    prabhu.padala

      version: fuse-6.1

      purpose: want to enable the JDBCAppender to log to a database

       

      in etc/org.ops4j.pax.logging.cfg, I made changes, added the appender:

      log4j.rootLogger=INFO, out, osgi:VmLogAppender, DB

       

      1. Database appender

      log4j.appender.DB=org.apache.log4j.jdbc.JDBCAppender

      log4j.appender.DB.URL=jdbc:oracle:thin:@//xxxx:1521/xxxx

      log4j.appender.DB.driver=oracle.jdbc.OracleDriver

      log4j.appender.DB.user=xxx

      log4j.appender.DB.password=xx

      log4j.appender.DB.Threshold=INFO

      log4j.appender.DB.sql=INSERT INTO xx_LOGS (USER_ID, DATED, LOGGER, LOG_LEVEL, MESSAGE) VALUES ('%x','%d','%C','%p','%m')

      log4j.appender.DB.layout=org.apache.log4j.PatternLayout

       

      I copied the jdbc driver jar file to the deploy - also fragment  bundle and attach it to pax-logging-service bundle

       

       

      however, I am not getting any error but log is not inserting into the database(log is locked no log in log file also)

       

      I followed below post How to get JDBCAppender working in FuseESB 4.4.1-01-13 (Newbie) but still i am not able make it.

      Could you please guide me setting up database logging ?

        • 1. Re: Jdbcappender is not working in fuse esb 6.1
          prabhu.padala
          1. I did following changes
          2. Reverted all my changes
          3. Added nullable to my table
          4. added below configuration back to configuration file log4j.rootLogger=INFO, out, osgi:VmLogAppender, DB log4j.appender.DB=org.apache.log4j.jdbc.JDBCAppender log4j.appender.DB.URL=jdbc:oracle:thin:@//xxxx:1521/xxxx log4j.appender.DB.driver=oracle.jdbc.OracleDriver log4j.appender.DB.user=xxx log4j.appender.DB.password=xx log4j.appender.DB.Threshold=INFO log4j.appender.DB.sql=INSERT INTO xx_LOGS (USER_ID, DATED, LOGGER, LOG_LEVEL, MESSAGE) VALUES ('%x','%d','%C','%p','%m')
          5. Installed ojdbc5.jar(without any fragment host-since we need this bundle for other dependency)
          6. Enabled root logger as DB
          7. Restarted by fuse server
          8. It started to inserting log in database .

           

          If you have any problem , Please reach me out through (prabhupmb@gmail.com)

           

          Thanks

          Prabhu Padala