8196768: RootLoggerHandlers fails when source tree is read-only

Reviewed-by: dfuchs
This commit is contained in:
Martin Buchholz 2018-02-05 20:20:35 -08:00
parent 0279b2d49a
commit b3597efef7
2 changed files with 2 additions and 0 deletions

View File

@ -132,6 +132,7 @@ public class BadRootLoggerHandlers {
}
Files.copy(initialProps, loggingProps, StandardCopyOption.REPLACE_EXISTING);
loggingProps.toFile().setWritable(true);
SystemErr err = new SystemErr(System.err);
System.setErr(new PrintStream(err));

View File

@ -63,6 +63,7 @@ public class RootLoggerHandlers {
Path loggingProps = USER_DIR.resolve(CONFIG_FILE);
System.setProperty("java.util.logging.config.file", loggingProps.toString());
Files.copy(initialProps, loggingProps, StandardCopyOption.REPLACE_EXISTING);
loggingProps.toFile().setWritable(true);
System.out.println("Root level is: " + Logger.getLogger("").getLevel());
if (Logger.getLogger("").getLevel() != Level.INFO) {
throw new RuntimeException("Expected root level INFO, got: "