Reputation: 16275
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
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