Hello everybody,
Beginners question here, hope all will be clear enough and log4j specific
enough.
I'm co-building an application that consists of around thirty java classes
that all use log4j.
We have a class called MyLogger.java that is imported by all these classes.
In MyLogger we have this line :
public static final org.apache.log4j.Logger log =
Logger.getLogger("MyLogger.class");
We use a log4jproperties file for now ,but the finished application will
take care that every user's log4j properties are read from his/her own
inifile (using PropertyConfigurator). At a certain point in our code we
determine which user we are dealing with , but until that time we would like
to use a default inifile.
As stated above , the logging object is created like this:
public static final org.apache.log4j.Logger log =
Logger.getLogger(RemLogger.class);
As far as i understand this object is created the first time one of our
classes imports the MyLogger class.
Would it be possible somehow to tweak this code so that the constructor of
MyLogger is called?
In the constructor i would place something like this:
URL url = Loader.getResource("default.ini");
PropertyConfigurator.configure(url);
Hope i made my question clear and would appreciate any help immensely!!
Thanks in advance,
Mark
--
View this message in context:
http://www.nabble.com/Beginners-question%3A-log4j-implementation%2C-variable-log4j-properties-tp22987689p22987689.html
Sent from the Log4j - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]