3 Replies Latest reply on Feb 16, 2009 10:37 AM by peterj

    Log4j JDBCAppender

    sgjava

      Has anyone got the JDBCAppender for Log4j to work within JBoss? Here's what I added to log4j.xml, but it appears to be ignored:






      <param name="sql" value=" INSERT INTO jbosslog (created, priority, message, username) VALUES (to_date('%d{yyyy-MM-dd HH:mm:ss}','YYYY-MM-DD HH24:MI:SS'), '%p', '%m', '%X{username}' "/>


        • 1. Re: Log4j JDBCAppender
          sgjava

          I needed to add <appender-ref ref="DATABASE"/> to the root section. I can get it to append records to an Oracle table, but some of the JBoss messages use single quotes (') which cause an insert failure.

          • 2. Re: Log4j JDBCAppender

            Hi

            Hope you are still using JBOSS.

            I tried using JDBCAppender to log my trace messages. The debug and info messages are logged in db, but not the trace. why?

            Thanks for your time

            regards
            KRS

            • 3. Re: Log4j JDBCAppender
              peterj

              mobaxkrs. please do not resurrect posts that are almost 7 years old!

              P.S. I hope you are not planning on spamming the forum by replying to every post dealing with logging to a database!