Custom logger on AS 6

Version 1

    I used a custom appender with previous jboss which worked fine. The appender was added programmatically. In jboss 6 it stopped working. I debugged the code and the appender is added fine, but append() is never called like before. Still use log4j and the rest of the logging logs fine to the logg file even though the switch to jboss-logging.

     

    My code is below:

     

    The class:

     

       class LocalAppender extends AppenderSkeleton {

     

          LocalAppender() {

             setLayout(new PatternLayout("%d %-5p [%c{1}] %m%n"));

             setThreshold(Level.INFO);

          }

     

          @SuppressWarnings({"unchecked"})

          protected void append(LoggingEvent event) {

             String formattedEvent = getLayout().format(event);

             synchronized(eventBuffer) {

                eventBuffer.add(formattedEvent);

             }

          }

     

          public boolean requiresLayout() {

             return true;

          }

     

          public void close() {

          }

       }

     

    Instantiate the class and added to the root appender:

     

    LocalAppender appender = new LocalAppender();

    Logger.getRootLogger().addAppender(appender);