Log4j Logger question

Hi,

I have a question on the dilemma i have. I am using Logger in a lot of places in my code base. Currently the level is set via log4j properties files. This require re-comiple every time i change the level. I am thinking to have a command-line variable which will store the level value. I then read that variable and call setLevel(). But this also requires reading/setting in several places.

So, i was thinking if i could create my own subclass MyLogger which will inherit from Logger that will take level from the constructor and somehow that will setLevel

I need your help if you can provide me a sample snippet on how this could be achieved or if you have a better idea.

Re: Log4j Logger question

I don't understand why you need to recompile every time you change if you have your preferences in a properties file. That is one of the points of having them set within a file - so that file may be stored external to the application. Are you packaging this file inside a jar? If so, is there anything from preventing you from storing this outside the jar?