ENT-11501: Re initialise the logging, after system property set.

This commit is contained in:
Adel El-Beik 2024-03-05 19:40:14 +00:00
parent 6bdad94236
commit 5c9164c94a
2 changed files with 4 additions and 1 deletions

View File

@ -5,7 +5,7 @@
cordaVersion=4.12 cordaVersion=4.12
versionSuffix=SNAPSHOT versionSuffix=SNAPSHOT
cordaShellVersion=4.12-HC01 cordaShellVersion=4.12-SNAPSHOT
gradlePluginsVersion=5.1.1 gradlePluginsVersion=5.1.1
artifactoryContextUrl=https://software.r3.com/artifactory artifactoryContextUrl=https://software.r3.com/artifactory
internalPublishVersion=1.+ internalPublishVersion=1.+

View File

@ -47,6 +47,8 @@ import net.corda.node.utilities.registration.NodeRegistrationException
import net.corda.nodeapi.internal.JVMAgentUtilities import net.corda.nodeapi.internal.JVMAgentUtilities
import net.corda.nodeapi.internal.addShutdownHook import net.corda.nodeapi.internal.addShutdownHook
import net.corda.nodeapi.internal.persistence.DatabaseIncompatibleException import net.corda.nodeapi.internal.persistence.DatabaseIncompatibleException
import org.apache.logging.log4j.LogManager
import org.apache.logging.log4j.core.LoggerContext
import org.fusesource.jansi.Ansi import org.fusesource.jansi.Ansi
import org.slf4j.bridge.SLF4JBridgeHandler import org.slf4j.bridge.SLF4JBridgeHandler
import picocli.CommandLine.Mixin import picocli.CommandLine.Mixin
@ -531,6 +533,7 @@ fun CliWrapperBase.initLogging(baseDirectory: Path): Boolean {
System.setProperty("consoleLogLevel", specifiedLogLevel) System.setProperty("consoleLogLevel", specifiedLogLevel)
Node.renderBasicInfoToConsole = false Node.renderBasicInfoToConsole = false
} }
(LogManager.getContext(false) as LoggerContext).reconfigure()
//Test for access to the logging path and shutdown if we are unable to reach it. //Test for access to the logging path and shutdown if we are unable to reach it.
val logPath = baseDirectory / NodeCliCommand.LOGS_DIRECTORY_NAME val logPath = baseDirectory / NodeCliCommand.LOGS_DIRECTORY_NAME