How use java.util.logging.config.class?

T

Tobias Besch

I want to use java.util.logging togehter with Web Start.
Since specifying a configuration file with the system property
java.util.logging.config.file does not work with Web Start
(because you cannot specify a file path) I'd like to try
java.util.logging.config.class and put that class into the classpath.

As I searched the Internet I found examples for specification of
configuration files.
But I couldn't find any example on how to specify logging properties
in a class.

Could you please help me?

Kindest Regards,
Tobias
 
O

Oscar kind

Tobias Besch said:
I want to use java.util.logging togehter with Web Start.
Since specifying a configuration file with the system property
java.util.logging.config.file does not work with Web Start
(because you cannot specify a file path) I'd like to try
java.util.logging.config.class and put that class into the classpath.

As I searched the Internet I found examples for specification of
configuration files.
But I couldn't find any example on how to specify logging properties
in a class.

IMHO, you've taken a wrong turn at the end: get the configuration file
from your .jar file and initialize logging with that.

An similar case can be found here (just one day old):
http://groups.google.com/[email protected]

Combine this with System#getResourceAsStream(String) and
LogManager#readConfiguration(InputStream) to feed the configuration file
into LogManager.
 
T

Tobias Besch

Oscar kind said:
IMHO, you've taken a wrong turn at the end: get the configuration file
from your .jar file and initialize logging with that.

[...]

Combine this with System#getResourceAsStream(String) and
LogManager#readConfiguration(InputStream) to feed the configuration file
into LogManager.

Thanks, a lot.
This is the solution I was looking for.

Cheers,
Tobias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,141
Latest member
BlissKeto
Top