Update:I continued to play with it and it appears the levels I'm setting from the Properties file are not working. It doesn't appear to have to do with 'over-riding' the values of the root logger. The properties file is working for the Log4J settings (such as PatternLayout), but not for my "HRUpdates.INNER" log.
Any clues are still appreciated.
==== original post ==== I'm using the example Log4J program in my own code. In it, they create different loggers. I'm using one called 'LOG' and one called 'INNER' for my code. The 'INNER' log is used for iterations and I don't always want it turned on.
My question has to do with how the log levels are set from a Property file. In the Log4J example program, they set the log levels in a property file. I tried to do the same but am running into a problem with the root logger over-riding the levels for a specific logger. In this case I'm setting the root logger to DEBUG and in the property file setting my INNER log to a higher level so I don't see the messages. It doesn't work and I still see the INNER log messages even though I set the level to something else. Is there a way to over-ride the root level in the other logger from the property file and I'm just doing it wrong? If I call 'setLevel' directly in the code for that logger it works fine. I am able to read in my property file correctly because any changes to the root logger property are affecting my output.
Thinking I had the levels reversed or something, I just tried setting the root logger to ERROR and over-riding the LOG logger with DEBUG but that didn't work either.
Here's the relevant portion of my property file:
In the example they specify the class like this:
In this particular project my jar is just HRUpdates so I don't think it's the level I qualified the class where the logger is but any clues you can provide are appreciated.
Here's the code where I create my logs:
If I need to RTFM better please let me know by pointing me to the right manual. I've checked some of the links off the Log4J page, including this one that includes the log level hierarchy, and they were pretty good but I didn't see any that mentioned what I might be doing wrong. [ July 14, 2005: Message edited by: Greg Ostravich ]
Was the problem that when the factory created my INNER log it doesn't really reside in HRUpdates but in fact resides in the scope of the Log4J class I'm using which is why my qualification didn't resolve to the correct object?
Am I explaining this very well?
Thanks again for your help. [ July 15, 2005: Message edited by: Greg Ostravich ]