| Author |
Can one set System property programmatically?
|
Bruce Jin
Ranch Hand
Joined: Sep 20, 2001
Posts: 666
|
|
I can set up system property at command line (note that test2 is the package name) C:\mrcgui>java -Djava.util.logging.config.file=test2/mylog.properties test2.TestLogging It works. But when I try to set property in the code, it never worked. === code == System.setProperty("java.util.logging.config.file", "test2/mylog.properties"); pf = System.getProperty("java.util.logging.config.file"); System.out.println("pf=" +pf); //prints test2/mylog.properties Logger logger = Logger.getLogger("test2"); === end of code === The logger still uses the default logger. Why? Thanks.
|
BJ - SCJP and SCWCD
We love Java programming. It is contagious, very cool, and lot of fun. - Peter Coad, Java Design
Crazy Bikes created by m-Power
|
 |
Dave Landers
Ranch Hand
Joined: Jul 24, 2002
Posts: 401
|
|
|
It probably initialized from the system property before you reset it.
|
 |
 |
|
|
subject: Can one set System property programmatically?
|
|
|