0 Replies Latest reply on Jun 9, 2008 12:01 PM by jbabuscio

    JBoss 4.2.2.GA issue with log4j and custom JDBCAppender

    jbabuscio

      I've come across an issue when transitioning my web application from using the DailyRollingFileAppender to a custom JDBCAppender.

      I receive this error:

      ERROR: invalid console appender config detected, console stream is looping

      in one specific location where it prints an uncaught exception.

      I extended JDBCAppender because it doesn't escape special characters nor does it encrypt passwords. To do this, I placed the single class in a separate .jar file from my application and it is then copied into the JBOSS_HOME/server/default/lib/ directory so it's loaded by JBoss's Classloader.

      I tried the following steps:
      1. Removed any old log4j references and made sure to point to reference this in my build but not include them twice.
      JBOSS_HOME\server\default\lib\log4j.jar
      JBOSS_HOME\server\default\lib\log4j-snmp-appender.jar

      2. Added this property to the run.conf and tried run.bat
      -Dorg.jboss.logging.Log4jService.catchSystemOut=false

      My application works to a point but then will stop. I can still click around but logging is completely suspended and any code that follows a logger call is never reached.

      When I don't extend the appender and use JDBCAppender or go back to using the DailyRollingFileAppender, it works fine.

      Does anyone have any suggestions? I'd rather like to escape the special characters rather than worry if my log statements are getting saved because somebody added a single quote to their logs. I sense that there's something being loaded twice but there are no references or other jars in my applications classpath. Another thing to note is that my application was always deployed in 4.0.3. This is a transition to 4.2.2GA as well as moving logs to the database.

      I appreciate any suggestions or feedback.