Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > java.util.logging, where to put logging.properties?

Reply
Thread Tools

java.util.logging, where to put logging.properties?

 
 
janne
Guest
Posts: n/a
 
      09-10-2004
I am doing some coding using java.util.logging, and can't seem to
figure out where to put logging.properties so that it could be found.
Actually I can get the properties working if I include the whole path
to the file in the -D initialization parameter, as in:

C:\Java\eclipse\workspace\projX\bin>java
-Djava.util.logging.config.file=C:\Java\eclipse\wor kspace\projX\bin\logging.properties
com.jannem.test.BasicTest

also, if I use a relative path to logging.properties from my current
directory, that works as well. But that's all a bit clumsy, I was
expecting that I could put logging.properties in my CLASSPATH
somewhere, and command

C:\Java\eclipse\workspace\projX\bin>java
-Djava.util.logging.config.file=logging.properties
com.jannem.test.BasicTest

would be able to find it. But it does not seem to be. I do not want to
modify the JRE-wide settings, I want to include a specific
configuration file for this application.

One attempt I tried was to put the whole thing to JAR, but I had no
luck with that either:

C:\Java\eclipse\workspace\projX>unzip -l test.jar
Archive: test.jar
Length Date Time Name
-------- ---- ---- ----
0 10-09-04 12:32 META-INF/
106 10-09-04 12:32 META-INF/MANIFEST.MF
0 10-09-04 11:49 com/
0 10-09-04 11:49 com/jannem/
0 10-09-04 11:49 com/jannem/test/
1425 10-09-04 12:06 com/jannem/test/BasicTest.class
2344 10-09-04 12:23 logging.properties
-------- -------
3875 7 files

C:\Java\eclipse\workspace\projX>java -cp test.jar
-Djava.util.logging.config.file=logging.properties
com.jannem.test.BasicTest

<...no log messages>

And ues, commons logging / Log4J would probably be less of a headache,
but that's not an option right now....
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why does the following with Queue, q.put('\x02', True) not put itin the queue? Gabriel Rossetti Python 3 04-25-2008 03:41 PM
Put javascript enable/disable checkbox on firefox toolbar? ted@loft.tnolan.com (Ted Nolan Firefox 2 06-04-2005 07:01 PM
Firefox 1.1 put on hold Posco Firefox 0 02-02-2005 01:45 PM
Where do I put *.xpi extensions / spiderzilla extension not found Kurt Firefox 6 12-09-2004 03:59 PM
Can't figure out how to put shortcut on desktop in FireFox JohnF Firefox 3 09-15-2004 01:22 PM



Advertisments