Aly
Aly

Reputation: 16275

java.util.logging.config

Is there a way to set the location of the properties file withough specifying a JVM param such as -Djava.util.logging.config.file=log.properties ?

Upvotes: 0

Views: 551

Answers (1)

Jonathan Feinberg
Jonathan Feinberg

Reputation: 45344

Yes. Per the documentation, you can configure the LogManager via the Preferences API.

InputStream inputStream = new FileInputStream("logging.properties");
LogManager.getLogManager().readConfiguration(inputStream);

Upvotes: 3

Related Questions