Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Logical bug in JavaUtilLog

Hi,

I think that there is a bug in JavaUtilLog:

public class JavaUtilLog extends AbstractLogger
[...]
    public JavaUtilLog(String name)
    {
        _logger = java.util.logging.Logger.getLogger(name);
        if (Boolean.parseBoolean(Log.__props.getProperty("org.eclipse.jetty.util.log.DEBUG", "false")))
        {
            _logger.setLevel(Level.FINE);
        }
        configuredLevel = _logger.getLevel();
    }
[...]
    public void setDebugEnabled(boolean enabled)
    {
        if (enabled)
        {
            configuredLevel = _logger.getLevel();
            _logger.setLevel(Level.FINE);
        }
        else
        {
            _logger.setLevel(configuredLevel);
        }
    }
[...]
}

I think configuredLevel should be instantiated before
the system property is evaluated. With the system-
property being set it's impossible to return to
non-debug-logging during runtime.


Thanks and cheers, Lothar


Back to the top