Seeing as there are problems (I’d like to say bugs, but until I find explicit documentation from Sun on this subject it’s hard to judge…) in java.util.logging’s post-initialization loading of configuration from a different properties file is, but it works OK with the “-D” runtime parameter, is there any way of programmatically filling that runtime parameter PRIOR to the initialization?
Obviously, you can set system properties inside your classes, but this is (it seems) called too late for the logging system (I’m guessing it initializes before then). Equally, you can tell every user that they MUST start java from a command line (Mac OS X users: ?) and that they MUST use your long and complicated command line to start it.
But that’s unacceptable - you completely lose the ability to have an autorunning JAR (no double click, no kernel-loading as an app, no simple “java -jar” command line).
The best I can think of so far is to try setting the system property in the static initializer of a class and keep my fingers crossed that this gets loaded and executed before ANY calls to the logging system. Perhaps if you’re really careful with how you write your code, you can wing it so that your initializer happens before the logging API’s classes are ever referenced, so that (one hopes) it’s identical to a command-line use of -D, as far as that API is concerned?
I thought that perhaps given the number of people around here who try / need to do the same thing (e.g. -Djava.library.path= as frequently used by the various native code OpenGL etc) that someone might have an answer / workaround? And…the fact that it’s used so much means an answer to my problem is likely to help quite a few others in the long run.

