geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Dillon <ja...@planet57.com>
Subject Re: Anyone know how to make the kernel tests be quiet?
Date Thu, 31 Aug 2006 03:40:30 GMT
Okay, I think I've found it... BootstrapLog4jLog and  
BootstrapJdk1.4Log both have static blocks that install logging  
configuration programatically.

I'm going to add a new method to GeronimoLogging, which will check if  
this behavior is enabled or not:

     /**
      * Check if the Geronimo bootstrap logging initialization is  
enabled.
      *
      * <p>Checks the system property  
<tt>geronimo.bootstrap.logging.enabled</tt>
      * if not set, or set to "true" then bootstrap logging  
initialization is enabled.
      *
      * @return  True of bootstrap logging initialization is enabled.
      */
     public static boolean isBootstrapLoggingInitializationEnabled() {
         String value = System.getProperty 
("geronimo.bootstrap.logging.enabled");
         if (value == null) {
             return true;
         }
         else {
             return Boolean.valueOf(value).booleanValue();
         }
     }

And then wrap the static blocks in the Log impls to only execute if  
isBootstrapLoggingInitializationEnabled() returns true.

Then to hook up, I'm going to specify - 
Dgeronimo.bootstrap.logging.enabled=false to the argLine in project- 
config.

This should leave things as per normal for running the server, and  
still allow the tests to be run from a single log4j logging  
configuration.  After this, target/test.log should contain DEBUG  
level messages for the tests run, and only ERROR+ will get written to  
console.

I'm going to double check... no triple check that this does not alter  
the servers logging and then commit.

--jason


On Aug 30, 2006, at 4:50 PM, Dain Sundstrom wrote:

> You should be able to turn on debugging, add a break point in the  
> logging code and see which test is causing the problem.
>
> -dain
>
> On Aug 30, 2006, at 4:31 PM, Jason Dillon wrote:
>
>> Looks like there is more going on which is causing tests to use  
>> some additional configuration for tests...
>>
>> Specifically, looks like something else is installing a  
>> ConsoleAppender... as if I comment out the CONSOLE definition from  
>> logging-config, then I still get console output.
>>
>> I'm also seeing that something is setting the root logger's  
>> level... as I've got the root configured to use DEBUG, but that  
>> will not output DEBUG logs to the test.log as I would expect.  I  
>> have to explicitly configure org.apache.geronimo to use DEBUG, and  
>> then I see the logs in test.log... but now with some rouge  
>> ConsoleAppender it spits out a bunch of junk to the console.
>>
>> Highly frustrating... :-(
>>
>> --jason
>>
>>
>> On Aug 30, 2006, at 3:53 PM, Jason Dillon wrote:
>>
>>> This is fixed now... though it still spits out a few ERROR logs,  
>>> which I am hoping are expected from the test...
>>>
>>> --jason
>>>
>>>
>>> On Aug 30, 2006, at 3:49 PM, Jason Dillon wrote:
>>>
>>>> Um... looks like a few of these tests are explicitly enabling  
>>>> DEBUG and installing a ConsoleAppender...
>>>>
>>>>     Logger.getRootLogger().addAppender(new ConsoleAppender(new  
>>>> PatternLayout("%p [%t] %m %n")));
>>>>     Logger.getRootLogger().setLevel(Level.DEBUG);
>>>>
>>>> I'm not sure how they were quiet before m2 with code like above  
>>>> in setUp().
>>>>
>>>> --jason
>>>>
>>>>
>>>> On Aug 28, 2006, at 4:29 PM, Jason Dillon wrote:
>>>>
>>>>> Thats odd, because the default logging config is set to only  
>>>>> allow WARN and ERROR to go to console, not DEBUG.
>>>>>
>>>>> Do these tests need to:
>>>>>
>>>>>     GeronimoLogging.initialize(GeronimoLogging.INFO);
>>>>>
>>>>> Or something?
>>>>>
>>>>> --jason
>>>>>
>>>>>
>>>>> On Aug 28, 2006, at 10:14 AM, Dain Sundstrom wrote:
>>>>>
>>>>>> Not me.  They were quiet before the m2 change but it looks  
>>>>>> like logging got turned up.
>>>>>>
>>>>>> -dain
>>>>>>
>>>>>> On Aug 28, 2006, at 2:26 AM, Jason Dillon wrote:
>>>>>>
>>>>>>> These tests make way... way to much noise.
>>>>>>>
>>>>>>> Anyone know how to make them shut up?
>>>>>>>
>>>>>>> --jason
>>>>>>
>>>>>
>>>>
>>>
>


Mime
View raw message