portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roshan G" <roshan...@hotmail.com>
Subject RE: Jetspeed's Log4j settings disable JBoss logging
Date Thu, 22 Jan 2004 15:06:13 GMT

I think the root logger is configured so that when jetspeed use Log4J its 
fully initialised.

Since Jboss also make use of Log4J,  by the time it loads jetspeed, Log4J is 
already initialised. So effectively jetspeed goes and overwrites Jboss's 
Log4J configuration.

One way of solving this problem is if we check if Log4J is initialised and 
if it is, only configure Jetspeed specific loggers (org.apache.jetspeed. 
namespace) . If its not then configure everything from root logger. This way 
it will work on tomcat which doesn't use Log4J and also on Jboss which uses 

There are some example code at

I have implemented this method to solve a similar problem. See code below

public synchronized static void configure() {
                if (!isConfigured()) {
                        // Log4J not configured, configure the root logger
                        Logger root = Logger.getRootLogger();


                // Configure our Application specific loggers.
                Properties p = new Properties();
                try {
                } catch (Exception e) {

private synchronized static boolean isConfigured() {
                Enumeration enum = Logger.getRoot().getAllAppenders();
                if ((enum != null) && (!(enum instanceof 
org.apache.log4j.helpers.NullEnumeration))) {
                        return true;
                } else {
                        Enumeration loggers = 
                        while (loggers.hasMoreElements()) {
                                Logger c = (Logger) loggers.nextElement();
                                if (!(c.getAllAppenders() instanceof 
                                        return true;
                return false;


>From: "Philipp Hug" <philipp@hug.cx>
>Reply-To: "Jetspeed Developers List" <jetspeed-dev@jakarta.apache.org>
>To: <jetspeed-dev@jakarta.apache.org>
>Subject: Jetspeed's Log4j settings disable JBoss logging
>Date: Thu, 22 Jan 2004 11:38:29 +0100
>The current settings in Log4j.properties disable logging in JBoss.
>Is there a reason to keep this line?
>log4j.rootLogger = INFO, jetspeed
>Is there any interest to improve the out-of-the-box experience for jboss
>deployments? If yes, I could probably help.

Check out the new MSN 9 Dial-up  fast & reliable Internet access with prime 
features! http://join.msn.com/?pgmarket=en-us&page=dialup/home&ST=1

To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org

View raw message