title: Custom Handler not added to own Logger
body: <p>i'm using a JBoss 7.1 and want to use a Custom Handler as a Module. The Problem is that the Handler is not added to my logger.</p>
  
  <hr>
  
  <p>standalone.xml:</p>
  
  <pre><code>   ...
  
     &lt;subsystem xmlns="urn:jboss:domain:logging:1.1"&gt;
  
     ...
  
        &lt;custom-handler name="CUSTOM" class="my.company.logging.handler.MyHandler" module="my.company.logging.handler"&gt;
              &lt;level name="INFO"/&gt;
              &lt;formatter&gt;
                  &lt;pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/&gt;
              &lt;/formatter&gt;
          &lt;/custom-handler&gt;
  
          ...
  
          &lt;logger category="my.company"&gt;
              &lt;level name="INFO"/&gt;
              &lt;handlers&gt;
                  &lt;handler name="CUSTOM"/&gt;
              &lt;/handlers&gt;
          &lt;/logger&gt;
  
          &lt;root-logger&gt;
              &lt;level name="INFO"/&gt;
              &lt;handlers&gt;
                  &lt;handler name="CONSOLE"/&gt;
                  &lt;handler name="FILE"/&gt;
              &lt;/handlers&gt;
          &lt;/root-logger&gt;
      &lt;/subsystem&gt;
  
      ...
  </code></pre>
  
  <hr>
  
  <p>A Demo Class using org.jboss.logging.Logger:
  ( The example class from the Quickstarts: "jboss-as-log4j" )</p>
  
  <pre><code>    package my.company.logging.test;
  
      @SessionScoped
      @Named
      public class LogDemo implements Serializable {
  
      private final Logger logger;
  
      private String text;
  
      public LogDemo() {
          logger = Logger.getLogger(getClass());
      }
  
      public String getText() {
          return text;
      }
  
      public void setText(String text) {
          this.text = text;
      }
  
      public void log() {
          logger.info(this.getText());
          this.setText(null);
      }
  }
  </code></pre>
  
  <hr>
  
  <p>In this way no Logs will be send to my Handler.</p>
  
  <p>I also tried to add the Handler to the RootLogger but than it works for all Log but not for the Logs from my own Logger.</p>
  
  <p>Does anybody know what the Problem could be?</p>
  
  <p>Greets
  Martin</p>
  
  <hr>
  
  <p>edit:</p>
  
  <p>MyHandler:</p>
  
  <pre><code>package my.company.logging.handler;
  
  public class MyHandler extends Handler {
  
      private MongoClient mongoClient;
      private DB db;
  
      public MyHandler() {
          System.out.println("new MyHandler");
          if (connect()) {
              System.out.println("Mongo connected!");
          } else {
              System.out.println("Mongo not connected!");
          }
      }
  
      private boolean connect() {
          try {
              this.mongoClient = new MongoClient();
              this.db = mongoClient.getDB("TestLogging");
              return true;
          } catch (UnknownHostException e) {
              return false;
          }
      }
  
      @Override
      public void close() throws SecurityException {
          mongoClient.close();
      }
  
      @Override
      public void flush() {
      }
  
      @Override
      public void publish(LogRecord record) {
          DBCollection collection = db.getCollection(record.getLoggerName());
          final BasicDBObject logRecord = new BasicDBObject("message",
                  record.getMessage());
  
          logRecord.put("level", record.getLevel().toString());
  
          Object[] parameters = record.getParameters();
          for (int i = 0; i &lt; parameters.length; i++) {
              logRecord.put("Parameter" + i, parameters[i].toString());
          }
  
          System.out.println("...");
          String result = collection.insert(logRecord).getError();
          if (result != null)
              System.out.println("something went wrong: " + result);
          else
              System.out.println("ok");
      }
  }
  </code></pre>
  
  <p>Note:
  When i add this Handler to the Root Logger in the standalone.xml it works for each Module exept my own war.</p>
  
  <p>Does the config only works with modules in JBoss or should it also works with war's?</p>