From a26c5c148308c1f55a548d7bb5af5ef49f0224e0 Mon Sep 17 00:00:00 2001 From: Michal Kit Date: Mon, 19 Mar 2018 08:26:27 +0000 Subject: [PATCH] Fixing exception logging for the HSM cert generator (#561) --- .../kotlin/com/r3/corda/networkmanage/hsm/generator/Main.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/network-management/src/main/kotlin/com/r3/corda/networkmanage/hsm/generator/Main.kt b/network-management/src/main/kotlin/com/r3/corda/networkmanage/hsm/generator/Main.kt index ae89620d71..7e38b5778f 100644 --- a/network-management/src/main/kotlin/com/r3/corda/networkmanage/hsm/generator/Main.kt +++ b/network-management/src/main/kotlin/com/r3/corda/networkmanage/hsm/generator/Main.kt @@ -15,7 +15,7 @@ import com.r3.corda.networkmanage.hsm.utils.mapCryptoServerException import net.corda.nodeapi.internal.crypto.CertificateType.ROOT_CA import org.apache.logging.log4j.LogManager -private val log = LogManager.getLogger("com.r3.corda.networkmanage.hsm.generator.Main") +private val logger = LogManager.getLogger("com.r3.corda.networkmanage.hsm.generator.Main") fun main(args: Array) { run(parseParameters(parseCommandLine(*args)?.configFile)) @@ -31,6 +31,7 @@ fun run(parameters: GeneratorParameters) { try { AutoAuthenticator(providerConfig, userConfigs).connectAndAuthenticate { provider -> val generator = KeyCertificateGenerator(this) + logger.info("Generating ${certConfig.certificateType.name} certificate.") if (certConfig.certificateType == ROOT_CA) { generator.generate(provider) } else { @@ -48,7 +49,7 @@ fun run(parameters: GeneratorParameters) { provider.logoff() } } catch (e: Exception) { - log.error(mapCryptoServerException(e)) + logger.error("HSM certificate generation error.", mapCryptoServerException(e)) } } } \ No newline at end of file