Fix Locking <file> log message
This commit is contained in:
parent
81d52d8f7f
commit
e15e69213b
|
@ -58,6 +58,7 @@ public final class Logging {
|
||||||
FileChannel channel = FileChannel.open(file.toPath(), StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.APPEND);
|
FileChannel channel = FileChannel.open(file.toPath(), StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.APPEND);
|
||||||
if (lock) {
|
if (lock) {
|
||||||
try {
|
try {
|
||||||
|
log.config("Locking " + file);
|
||||||
channel.lock();
|
channel.lock();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new IOException("Failed to acquire lock: " + file, e);
|
throw new IOException("Failed to acquire lock: " + file, e);
|
||||||
|
|
|
@ -392,9 +392,6 @@ public class Main {
|
||||||
|
|
||||||
// tee stdout and stderr to log file if --log-file is set
|
// tee stdout and stderr to log file if --log-file is set
|
||||||
if (args.logFile != null) {
|
if (args.logFile != null) {
|
||||||
if (args.logLock) {
|
|
||||||
log.config("Locking " + log);
|
|
||||||
}
|
|
||||||
Handler logFileHandler = createLogFileHandler(args.getLogFile(), args.logLock, Level.ALL);
|
Handler logFileHandler = createLogFileHandler(args.getLogFile(), args.logLock, Level.ALL);
|
||||||
log.addHandler(logFileHandler);
|
log.addHandler(logFileHandler);
|
||||||
debug.addHandler(logFileHandler);
|
debug.addHandler(logFileHandler);
|
||||||
|
|
Loading…
Reference in New Issue