#3 resetConfiguration sets root logger level to nil

open
nobody
None
5
2009-07-24
2009-07-24
Martin Heinrich
No

When resetting the Log4Cocoa using [[L4Logger loggerRepository] resetConfiguration] the follwoing error message is written to the consle: "log4cocoa: ERROR: You have tried to set a null level to root".

The problem is caused by the loop in L4LoggerStore resetConfiguration, which sets each logger's level to nil. This includes the root logger. The loop should test each logger and only set the level, if it is not the root logger.

L4LoggerStore line 216

[logger setLevel:nil];

Change to something like

if (logger != root)
{
[logger setLevel:nil];
}

Discussion