On 30/10/2007, at 10:34 AM, Joshua ChaitinPollak wrote:

On Fri, 2007-10-26 at 07:59 +1000, Paul Smith wrote:
On 26/10/2007, at 5:26 AM, Joshua ChaitinPollak wrote:
If you had the time, crafting a unit test based on the other unit
tests in the bridge project would be most useful to demonstrate a
problem if there was one.. ?

Perhaps an example of your log4j configuration process (config file)
and an example of the TRACE level logging event being output to a file?

cheers,

Paul

Paul,

Below is a class I've created that demonstrates the problem, along with simple instructions on how to create a project to execute the code. When
I run the test I see:

Running org.apache.AppTest
2007-10-29 18:22:30,474 [10] TRACE test.logger - Finest
2007-10-29 18:22:30,478 [10] DEBUG test.logger - Finer
2007-10-29 18:22:30,479 [10] DEBUG test.logger - Fine
2007-10-29 18:22:30,479 [10] WARN  test.logger - Warning
2007-10-29 18:22:30,479 [10] ERROR test.logger - Severe
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.275
sec

But I'm setting:

loggingProperties.setProperty("log4j.logger.test.logger", "WARN");

So I would expect to only see the Warning and Severe lines.

Any help would be appreciated.

-Josh

Here are the steps I took:

</snip>

Well... Great find Joshua, I'll have to eat my hat! I really appreciate the description of your test code. I massaged it into an actual unit test, which failed, and allowed me to isolate the bug. It's now in svn as of revision 589940 and a new SNAPSHOT has been produced which should address the problem:

http://people.apache.org/~psmith/logging.apache.org/repo/org/apache/logging/apache-jul-log4j-bridge/1.0.0-SNAPSHOT/apache-jul-log4j-bridge-1.0.0-20071030.022816-5.jar

Looks like all jdk logging events were being posted to all appenders regardless of their current level configuration. Oops!

cheers,

Paul

Reply via email to