mirror of
https://github.com/corda/corda.git
synced 2024-12-24 07:06:44 +00:00
Tidy up DemoBench's fallback logging configuration for JUL. (#3894)
This commit is contained in:
parent
be45096082
commit
7f3bcbe7c3
@ -10,6 +10,7 @@ import java.util.logging.*;
|
||||
* to be added to the JVM's command line.
|
||||
*/
|
||||
public class LoggingConfig {
|
||||
private static final String LOGGING_CONFIG = "logging.properties";
|
||||
|
||||
public LoggingConfig() throws IOException {
|
||||
try (InputStream input = getLoggingProperties()) {
|
||||
@ -20,10 +21,11 @@ public class LoggingConfig {
|
||||
|
||||
private static InputStream getLoggingProperties() throws IOException {
|
||||
ClassLoader classLoader = LoggingConfig.class.getClassLoader();
|
||||
InputStream input = classLoader.getResourceAsStream("logging.properties");
|
||||
InputStream input = classLoader.getResourceAsStream(LOGGING_CONFIG);
|
||||
if (input == null) {
|
||||
Path javaHome = Paths.get(System.getProperty("java.home"));
|
||||
input = Files.newInputStream(javaHome.resolve("lib").resolve("logging.properties"));
|
||||
// Use the default JUL logging configuration properties instead.
|
||||
Path logging = Paths.get(System.getProperty("java.home"), "lib", LOGGING_CONFIG);
|
||||
input = Files.newInputStream(logging, StandardOpenOption.READ);
|
||||
}
|
||||
return input;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user