[jboss-cvs] JBossAS SVN: r75507 - in branches/Branch_4_2: server/src/etc/conf/default and 4 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jul 8 16:15:08 EDT 2008


Author: stan.silvert at jboss.com
Date: 2008-07-08 16:15:07 -0400 (Tue, 08 Jul 2008)
New Revision: 75507

Added:
   branches/Branch_4_2/testsuite/src/jdk15/org/jboss/test/jsf/webapp/LoggingTest.java
Modified:
   branches/Branch_4_2/build/build-thirdparty.xml
   branches/Branch_4_2/server/src/etc/conf/default/jboss-log4j.xml
   branches/Branch_4_2/testsuite/src/main/org/jboss/test/web/test/JSFIntegrationUnitTestCase.java
   branches/Branch_4_2/testsuite/src/resources/web/html/jsftest/index.jsp
   branches/Branch_4_2/tomcat/src/main/org/jboss/web/jsf/integration/config/JBossJSFConfigureListener.java
   branches/Branch_4_2/tomcat/src/main/org/jboss/web/jsf/integration/config/Log4JConversionFilter.java
Log:
JBAS-4877


Modified: branches/Branch_4_2/build/build-thirdparty.xml
===================================================================
--- branches/Branch_4_2/build/build-thirdparty.xml	2008-07-08 18:12:19 UTC (rev 75506)
+++ branches/Branch_4_2/build/build-thirdparty.xml	2008-07-08 20:15:07 UTC (rev 75507)
@@ -104,7 +104,7 @@
     <componentref name="sun-jaf" version="1.1"/>
     <componentref name="sun-javacc" version="3.2"/>
     <componentref name="sun-javamail" version="1.4"/>
-    <componentref name="sun-jsf" version="1.2_04_P02"/>
+    <componentref name="sun-jsf" version="1.2_08"/>
     <componentref name="sun-jstl" version="1.2"/>
     <componentref name="sun-servlet" version="2.5-brew"/>
     <componentref name="trove" version="1.0.2-brew"/>

Modified: branches/Branch_4_2/server/src/etc/conf/default/jboss-log4j.xml
===================================================================
--- branches/Branch_4_2/server/src/etc/conf/default/jboss-log4j.xml	2008-07-08 18:12:19 UTC (rev 75506)
+++ branches/Branch_4_2/server/src/etc/conf/default/jboss-log4j.xml	2008-07-08 20:15:07 UTC (rev 75507)
@@ -179,6 +179,11 @@
       <priority value="INFO"/>
    </category>
 
+   <!-- Limit JSF logging to DEBUG.  FINER and FINEST will not be logged -->
+   <category name="javax.enterprise.resource.webcontainer.jsf">
+      <priority value="DEBUG" />
+   </category>
+                
    <!-- Limit JBoss categories
    <category name="org.jboss">
       <priority value="INFO"/>

Added: branches/Branch_4_2/testsuite/src/jdk15/org/jboss/test/jsf/webapp/LoggingTest.java
===================================================================
--- branches/Branch_4_2/testsuite/src/jdk15/org/jboss/test/jsf/webapp/LoggingTest.java	                        (rev 0)
+++ branches/Branch_4_2/testsuite/src/jdk15/org/jboss/test/jsf/webapp/LoggingTest.java	2008-07-08 20:15:07 UTC (rev 75507)
@@ -0,0 +1,111 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.jsf.webapp;
+
+import com.sun.faces.util.FacesLogger;
+import org.apache.log4j.*;
+import java.io.ByteArrayOutputStream;
+
+/**
+ * This class simulates the kind of logging that the JSF implementation
+ * does.  
+ *
+ * @author Stan Silvert
+ */
+public class LoggingTest {
+    
+   private ByteArrayOutputStream out = new ByteArrayOutputStream();
+
+   /**
+    * Constructor sets up an in-memory Log4J appender.  Log messages
+    * logged with the java.util.logging package should end up in this
+    * appender.
+    */
+   public LoggingTest()
+   {
+      Appender appender = new WriterAppender(new SimpleLayout(), out);
+      Logger log4jLogger = Logger.getLogger("javax.enterprise.resource.webcontainer.jsf");
+      log4jLogger.addAppender(appender);
+   }
+
+   /**
+    * Send java.util.logging messages using the same java.util Loggers
+    * that the JSF impl uses.
+    * 
+    * During the JUnit test, levels are set on the loggers so that
+    * some messages will pass thorough to log4j and 
+    * captured by the WriterAppender.  Others will not.
+    */
+   public void sendLogMessages()
+   {
+      java.util.logging.Logger julLogger = FacesLogger.RENDERKIT.getLogger();
+      if (julLogger.isLoggable(java.util.logging.Level.SEVERE)) 
+         throw new RuntimeException(julLogger.getName() + " should not be loggable for SEVERE.");
+      julLogger.severe("Logged SEVERE message in RENDERKIT_LOGGER<br/>"); // not logged 
+
+      julLogger = FacesLogger.TAGLIB.getLogger();
+      julLogger.severe("Logged SEVERE message in TAGLIB_LOGGER<br/>"); // not logged
+
+      julLogger = FacesLogger.APPLICATION.getLogger();
+      julLogger.severe("Logged SEVERE message in APPLICATION_LOGGER<br/>"); // logged
+      if (julLogger.isLoggable(java.util.logging.Level.WARNING)) 
+         throw new RuntimeException(julLogger.getName() + " should not be loggable for WARNING.");
+      julLogger.warning("Logged WARNING message in APPLICATION_LOGGER<br/>"); // not logged
+
+      julLogger = FacesLogger.CONTEXT.getLogger();
+      julLogger.warning("Logged WARNING message in CONTEXT_LOGGER<br/>"); // logged
+      if (julLogger.isLoggable(java.util.logging.Level.INFO)) 
+         throw new RuntimeException(julLogger.getName() + " should not be loggable for INFO.");
+      julLogger.info("Logged INFO message in CONTEXT_LOGGER<br/>"); // not logged
+
+      julLogger = FacesLogger.CONFIG.getLogger();
+      julLogger.info("Logged INFO message in CONFIG_LOGGER<br/>"); // logged 
+      if (julLogger.isLoggable(java.util.logging.Level.FINE)) 
+         throw new RuntimeException(julLogger.getName() + " should not be loggable for FINE.");
+      julLogger.fine("Logged FINE message in CONFIG_LOGGER<br/>"); // not logged
+
+      julLogger = FacesLogger.LIFECYCLE.getLogger();
+      julLogger.fine("Logged FINE message in LIFECYCLE_LOGGER<br/>"); // logged
+      if (julLogger.isLoggable(java.util.logging.Level.FINER)) 
+         throw new RuntimeException(julLogger.getName() + " should not be loggable for FINER.");
+      julLogger.finer("Logged FINER message in LIFECYCLE_LOGGER<br/>"); // not logged
+      if (julLogger.isLoggable(java.util.logging.Level.FINEST)) 
+         throw new RuntimeException(julLogger.getName() + " should not be loggable for FINEST.");
+      julLogger.finest("Logged FINER message in LIFECYCLE_LOGGER<br/>"); // not logged
+
+      julLogger = FacesLogger.TIMING.getLogger();
+      julLogger.finer("Logged FINER message in TIMING_LOGGER<br/>"); // logged
+      julLogger.finest("Logged FINEST message in TIMING_LOGGER<br/>"); // logged
+
+      julLogger = FacesLogger.MANAGEDBEAN.getLogger();
+      julLogger.finest("Logged FINEST message in MANAGEDBEAN_LOGGER Logger<br/>"); // logged
+   }
+
+   /**
+    * Return the contents of the in-memory Log4J appender.
+    */
+   public String getLoggedMessages()
+   {
+      return out.toString();
+   }
+}

Modified: branches/Branch_4_2/testsuite/src/main/org/jboss/test/web/test/JSFIntegrationUnitTestCase.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/web/test/JSFIntegrationUnitTestCase.java	2008-07-08 18:12:19 UTC (rev 75506)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/web/test/JSFIntegrationUnitTestCase.java	2008-07-08 20:15:07 UTC (rev 75507)
@@ -21,9 +21,9 @@
 */
 package org.jboss.test.web.test;
 
-//import java.net.HttpURLConnection;
+import com.sun.faces.util.FacesLogger;
+
 import java.net.URL;
-//import javax.management.ObjectName;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -48,9 +48,33 @@
  */
 public class JSFIntegrationUnitTestCase extends JBossTestCase
 {
-   private String baseURL = HttpUtils.getBaseURL(); 
-   private HttpClient client = new HttpClient();
-   
+   // Call Log4jService to set logging levels for the JSF impl before the WAR
+   // is deployed
+   public static void setLoggingLevels() throws Exception
+   {
+      HttpClient client = new HttpClient();
+      client.executeMethod(new GetMethod(makeSetLoggerCmd(FacesLogger.MANAGEDBEAN.getLoggerName(), "ALL")));
+      client.executeMethod(new GetMethod(makeSetLoggerCmd(FacesLogger.TAGLIB.getLoggerName(), "FATAL")));
+      client.executeMethod(new GetMethod(makeSetLoggerCmd(FacesLogger.APPLICATION.getLoggerName(), "ERROR")));
+      client.executeMethod(new GetMethod(makeSetLoggerCmd(FacesLogger.CONTEXT.getLoggerName(), "WARN")));
+      client.executeMethod(new GetMethod(makeSetLoggerCmd(FacesLogger.CONFIG.getLoggerName(), "INFO")));
+      client.executeMethod(new GetMethod(makeSetLoggerCmd(FacesLogger.LIFECYCLE.getLoggerName(), "DEBUG")));
+      client.executeMethod(new GetMethod(makeSetLoggerCmd(FacesLogger.TIMING.getLoggerName(), "TRACE")));
+      client.executeMethod(new GetMethod(makeSetLoggerCmd(FacesLogger.RENDERKIT.getLoggerName(), "OFF")));
+   }
+
+   private static String makeSetLoggerCmd(String log4jLogger, String log4jPriority)
+   {
+      String baseURL = HttpUtils.getBaseURL();
+      return baseURL + 
+             "jmx-console/HtmlAdaptor?" +
+             "action=invokeOp&" +
+             "name=jboss.system:type=Log4jService,service=Logging&" +
+             "methodIndex=1&" +
+             "arg0=" + log4jLogger + "&" +
+             "arg1=" + log4jPriority;
+   }
+
    public JSFIntegrationUnitTestCase(String name)
    {
       super(name);
@@ -60,8 +84,9 @@
     */
    public void testJSFIntegrated() throws Exception
    {
+      HttpClient client = new HttpClient();
       client.executeMethod(makeRequest());
-
+      
       HttpMethodBase result = makeRequest();
 
       // need to hit it twice with the same session for test to pass
@@ -83,6 +108,23 @@
 
       // Tests enum support 
       assertTrue(contains(responseBody, "JBoss Color selection is PURPLE"));
+
+      // Test logging
+      assertFalse(contains(responseBody, "Logged SEVERE message in RENDERKIT_LOGGER"));
+      assertFalse(contains(responseBody, "Logged SEVERE message in TAGLIB_LOGGER"));
+      assertTrue(contains(responseBody, "Logged SEVERE message in APPLICATION_LOGGER"));
+      assertFalse(contains(responseBody, "Logged WARNING message in APPLICATION_LOGGER"));
+      assertTrue(contains(responseBody, "Logged WARNING message in CONTEXT_LOGGER"));
+      assertFalse(contains(responseBody, "Logged INFO message in CONTEXT_LOGGER"));
+      assertTrue(contains(responseBody, "Logged INFO message in CONFIG_LOGGER"));
+      assertFalse(contains(responseBody, "Logged FINE message in CONFIG_LOGGER"));
+      assertTrue(contains(responseBody, "Logged FINE message in LIFECYCLE_LOGGER"));
+      assertFalse(contains(responseBody, "Logged FINER message in LIFECYCLE_LOGGER"));
+      assertFalse(contains(responseBody, "Logged FINEST message in LIFECYCLE_LOGGER"));
+      assertTrue(contains(responseBody, "Logged FINER message in TIMING_LOGGER"));
+      assertTrue(contains(responseBody, "Logged FINEST message in TIMING_LOGGER"));
+      assertTrue(contains(responseBody, "Logged FINEST message in MANAGEDBEAN_LOGGER"));
+      
    }   
 
    private boolean contains(String base, String target) {
@@ -90,11 +132,15 @@
    }
 
    private GetMethod makeRequest() {
+      String baseURL = HttpUtils.getBaseURL();
       return new GetMethod(baseURL+"jbosstest-jsf/index.jsf");
    }
 
    public static Test suite() throws Exception
    {
+      // need to set up the JSF loggers before the WAR is deployed
+      setLoggingLevels();
+      
       TestSuite suite = new TestSuite();
       suite.addTest(new TestSuite(JSFIntegrationUnitTestCase.class));
 

Modified: branches/Branch_4_2/testsuite/src/resources/web/html/jsftest/index.jsp
===================================================================
--- branches/Branch_4_2/testsuite/src/resources/web/html/jsftest/index.jsp	2008-07-08 18:12:19 UTC (rev 75506)
+++ branches/Branch_4_2/testsuite/src/resources/web/html/jsftest/index.jsp	2008-07-08 20:15:07 UTC (rev 75507)
@@ -1,5 +1,6 @@
 <%@page contentType="text/html"%>
 <%@page pageEncoding="UTF-8"%>
+<%@page import="org.jboss.test.jsf.webapp.*" %>
 <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
 <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
@@ -20,7 +21,7 @@
          <%
                // I think that the fact I need to do this constitutes a bug in JSTL
                if (session.getAttribute("mySessionBean") == null) {
-                    session.setAttribute("mySessionBean", new org.jboss.test.jsf.webapp.MySessionBean()); 
+                    session.setAttribute("mySessionBean", new MySessionBean()); 
                }
           %>
           
@@ -38,5 +39,13 @@
                            /></h3>
      </f:view>
  
+       <font color="red"><h1>Logging Test</h1></font>
+       <h3>
+       <%
+           LoggingTest loggingTest = new LoggingTest();
+           loggingTest.sendLogMessages();
+           out.println(loggingTest.getLoggedMessages());
+        %>
+       </h3>
     </body>
 </html>

Modified: branches/Branch_4_2/tomcat/src/main/org/jboss/web/jsf/integration/config/JBossJSFConfigureListener.java
===================================================================
--- branches/Branch_4_2/tomcat/src/main/org/jboss/web/jsf/integration/config/JBossJSFConfigureListener.java	2008-07-08 18:12:19 UTC (rev 75506)
+++ branches/Branch_4_2/tomcat/src/main/org/jboss/web/jsf/integration/config/JBossJSFConfigureListener.java	2008-07-08 20:15:07 UTC (rev 75507)
@@ -1,6 +1,6 @@
 /*
  * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
  * by the @authors tag. See the copyright.txt in the distribution for a
  * full listing of individual contributors.
  *
@@ -23,10 +23,11 @@
 package org.jboss.web.jsf.integration.config;
 
 import com.sun.faces.config.ConfigureListener;
-import com.sun.faces.util.Util;
+import com.sun.faces.util.FacesLogger;
 import java.util.logging.Filter;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletContextEvent;
+import org.apache.log4j.Level;
 import org.jboss.logging.Logger;
 
 /**
@@ -38,12 +39,13 @@
 public class JBossJSFConfigureListener extends ConfigureListener 
 {
     private static final String WAR_BUNDLES_JSF_IMPL = "org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL";
-
+   
     private static Logger LOG = Logger.getLogger(JBossJSFConfigureListener.class);
     
+    public static final String BASE_JSF_LOGGER = "javax.enterprise.resource.webcontainer.jsf";
+    
     public static final String SHOULD_LOG_CONFIG_MESSAGES = "com.sun.faces.displayConfiguration";
     
-    
     private ServletContext servletContext;
     
     public static boolean warBundlesJSFImpl(ServletContext servletContext)
@@ -65,10 +67,27 @@
         }
 
         checkForMyFaces();
-
+        initializeJspRuntime();
         super.contextInitialized(event);
     }
     
+    // This method accounts for a peculiar problem with Jasper that pops up from time
+    // to time.  In some cases, if the JspRuntimeContext is not loaded then the JspFactory
+    // will not be initialized for JSF.  This method assures that it will always be
+    // be loaded before JSF is initialized.
+    private static void initializeJspRuntime() 
+    {
+
+        try 
+        {
+            Class.forName("org.apache.jasper.compiler.JspRuntimeContext");
+        }  
+        catch (ClassNotFoundException cnfe) 
+        {
+            // do nothing 
+        }
+    }
+
     private void checkForMyFaces()
     {
         try
@@ -83,28 +102,87 @@
             // ignore - this is a good thing
         }
     }
+
     /**
+     * For a given JSF julLogger find the logging level set to the
+     * corresponding log4jLogger.  Then set the julLogger to the
+     * same level as the log4jLogger.
+     *
+     * At this point we know that Log4J is being used.  So we can
+     * reference a real Log4J logger instead of the JBoss one.
+     */
+    private void setLevel(java.util.logging.Logger julLogger)
+    {
+        org.apache.log4j.Logger log4jLogger = 
+            org.apache.log4j.Logger.getLogger(julLogger.getName());
+
+        julLogger.setLevel(java.util.logging.Level.OFF);
+
+        if (log4jLogger.isEnabledFor(Level.FATAL))
+            julLogger.setLevel(java.util.logging.Level.SEVERE);
+
+        if (log4jLogger.isEnabledFor(Level.ERROR))
+            julLogger.setLevel(java.util.logging.Level.SEVERE);
+
+        if (log4jLogger.isEnabledFor(Level.WARN))
+            julLogger.setLevel(java.util.logging.Level.WARNING);
+
+        if (log4jLogger.isEnabledFor(Level.INFO))
+            julLogger.setLevel(java.util.logging.Level.INFO);
+ 
+        if (log4jLogger.isEnabledFor(Level.DEBUG)) 
+            julLogger.setLevel(java.util.logging.Level.FINE);
+
+        if (log4jLogger.isEnabledFor(Level.TRACE))
+            julLogger.setLevel(java.util.logging.Level.FINEST);
+
+        if (log4jLogger.isEnabledFor(Level.ALL))
+            julLogger.setLevel(java.util.logging.Level.ALL);
+    }
+
+    /**
      * If Log4J is being used, set a filter that converts JSF RI java.util.logger
      * messages to Log4J messages.
      */
     private void setLog4J() 
     {
         Filter conversionFilter = new Log4JConversionFilter(logConfigMessages());
+
+        java.util.logging.Logger julLogger = java.util.logging.Logger.getLogger(BASE_JSF_LOGGER);
+        setLevel(julLogger);
+        julLogger.setFilter(conversionFilter);
+
+        julLogger = FacesLogger.APPLICATION.getLogger();
+        setLevel(julLogger);
+        julLogger.setFilter(conversionFilter);
+
+        julLogger = FacesLogger.CONFIG.getLogger();
+        setLevel(julLogger);
+        julLogger.setFilter(conversionFilter);
+
+        julLogger = FacesLogger.CONTEXT.getLogger();
+        setLevel(julLogger);
+        julLogger.setFilter(conversionFilter);
+
+        julLogger = FacesLogger.LIFECYCLE.getLogger();
+        setLevel(julLogger);
+        julLogger.setFilter(conversionFilter);
         
-        java.util.logging.Logger.getLogger(Util.FACES_LOGGER)
-                                .setFilter(conversionFilter);
-        java.util.logging.Logger.getLogger(Util.FACES_LOGGER + Util.APPLICATION_LOGGER)
-                                .setFilter(conversionFilter);
-        java.util.logging.Logger.getLogger(Util.FACES_LOGGER + Util.CONFIG_LOGGER)
-                                .setFilter(conversionFilter);
-        java.util.logging.Logger.getLogger(Util.FACES_LOGGER + Util.CONTEXT_LOGGER)
-                                .setFilter(conversionFilter);
-        java.util.logging.Logger.getLogger(Util.FACES_LOGGER + Util.LIFECYCLE_LOGGER)
-                                .setFilter(conversionFilter);
-        java.util.logging.Logger.getLogger(Util.FACES_LOGGER + Util.RENDERKIT_LOGGER)
-                                .setFilter(conversionFilter);
-        java.util.logging.Logger.getLogger(Util.FACES_LOGGER + Util.TAGLIB_LOGGER)
-                                .setFilter(conversionFilter);
+        julLogger = FacesLogger.MANAGEDBEAN.getLogger();
+        setLevel(julLogger);
+        julLogger.setFilter(conversionFilter);
+
+        julLogger = FacesLogger.RENDERKIT.getLogger();
+        setLevel(julLogger);
+        julLogger.setFilter(conversionFilter);
+
+        julLogger = FacesLogger.TAGLIB.getLogger();
+        setLevel(julLogger);
+        julLogger.setFilter(conversionFilter);
+        
+        julLogger = FacesLogger.TIMING.getLogger();
+        setLevel(julLogger);
+        julLogger.setFilter(conversionFilter);
     }
     
     // should we log the configuration messages?

Modified: branches/Branch_4_2/tomcat/src/main/org/jboss/web/jsf/integration/config/Log4JConversionFilter.java
===================================================================
--- branches/Branch_4_2/tomcat/src/main/org/jboss/web/jsf/integration/config/Log4JConversionFilter.java	2008-07-08 18:12:19 UTC (rev 75506)
+++ branches/Branch_4_2/tomcat/src/main/org/jboss/web/jsf/integration/config/Log4JConversionFilter.java	2008-07-08 20:15:07 UTC (rev 75507)
@@ -1,6 +1,6 @@
 /*
  * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
  * by the @authors tag. See the copyright.txt in the distribution for a
  * full listing of individual contributors.
  *
@@ -92,23 +92,37 @@
         Object message = formatter.formatMessage(record);
         Throwable throwable = record.getThrown();
         
-        if (loggedLevel == Level.INFO.intValue()) 
+        if (loggedLevel == Level.SEVERE.intValue())
         {
-            logger.info(message, throwable);
-            return;
+           logger.error(message, throwable);
+           return;
         }
-        
-        if (loggedLevel == Level.WARNING.intValue()) 
+
+        if (loggedLevel == Level.WARNING.intValue())
         {
-            logger.warn(message, throwable);
-            return;
+           logger.warn(message, throwable);
+           return;
         }
+
+        if ((loggedLevel == Level.INFO.intValue()) ||
+            (loggedLevel == Level.CONFIG.intValue()))
+        {
+           logger.info(message, throwable);
+           return;
+        }
         
-        if (loggedLevel == Level.SEVERE.intValue()) 
+        if (loggedLevel == Level.FINE.intValue())
         {
-            logger.fatal(message, throwable);
-            return;
+           logger.debug(message, throwable);
+           return;
         }
+
+        if ((loggedLevel == Level.FINER.intValue()) ||
+            (loggedLevel == Level.FINEST.intValue()))
+        {
+           logger.trace(message, throwable);
+           return;
+        }
     
         logger.info(message, throwable);
     }
@@ -118,24 +132,38 @@
         int loggedLevel = record.getLevel().intValue();
         Object message = formatter.formatMessage(record);
         
-        if (loggedLevel == Level.INFO.intValue()) 
+        if (loggedLevel == Level.SEVERE.intValue())
         {
-            logger.info(message);
-            return;
+           logger.error(message);
+           return;
         }
-        
-        if (loggedLevel == Level.WARNING.intValue()) 
+
+        if (loggedLevel == Level.WARNING.intValue())
         {
-            logger.warn(message);
-            return;
+           logger.warn(message);
+           return;
         }
+
+        if ((loggedLevel == Level.INFO.intValue()) ||
+            (loggedLevel == Level.CONFIG.intValue()))
+        {
+           logger.info(message);
+           return;
+        }
         
-        if (loggedLevel == Level.SEVERE.intValue()) 
+        if (loggedLevel == Level.FINE.intValue())
         {
-            logger.fatal(message);
-            return;
+           logger.debug(message);
+           return;
         }
-    
+
+        if ((loggedLevel == Level.FINER.intValue()) ||
+            (loggedLevel == Level.FINEST.intValue()))
+        {
+           logger.trace(message);
+           return;
+        }
+
         logger.info(message);
     }
     




More information about the jboss-cvs-commits mailing list