mirror of
https://github.com/corda/corda.git
synced 2024-12-21 13:57:54 +00:00
CORDA-2862: Fix to allow softlinks of logs directory (#5034)
This commit is contained in:
parent
f723f8c768
commit
87fe7b4d88
@ -38,6 +38,7 @@ import java.io.RandomAccessFile
|
||||
import java.lang.management.ManagementFactory
|
||||
import java.net.InetAddress
|
||||
import java.nio.channels.UnresolvedAddressException
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Path
|
||||
import java.time.DayOfWeek
|
||||
import java.time.ZonedDateTime
|
||||
@ -486,7 +487,11 @@ fun CliWrapperBase.initLogging(baseDirectory: Path): Boolean {
|
||||
//Test for access to the logging path and shutdown if we are unable to reach it.
|
||||
val logPath = baseDirectory / NodeCliCommand.LOGS_DIRECTORY_NAME
|
||||
try {
|
||||
logPath.createDirectories()
|
||||
if (Files.isSymbolicLink(logPath)){
|
||||
Files.readSymbolicLink(logPath).createDirectories()
|
||||
} else {
|
||||
logPath.createDirectories()
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
printError("Unable to create logging directory ${logPath.toString()}. Node will now shutdown.")
|
||||
return false
|
||||
|
Loading…
Reference in New Issue
Block a user