From a08c52f59def31f301059c87a47820f96354334d Mon Sep 17 00:00:00 2001 From: JeffreyDallas <39912573+JeffreyDallas@users.noreply.github.com> Date: Thu, 9 May 2024 16:25:30 -0500 Subject: [PATCH] chore: update log4j2 to align with hedera repo (#274) Signed-off-by: Jeffrey Tang --- resources/templates/log4j2.xml | 80 +++++++++++++++++++++++++--------- src/commands/node.mjs | 8 ++-- 2 files changed, 63 insertions(+), 25 deletions(-) diff --git a/resources/templates/log4j2.xml b/resources/templates/log4j2.xml index 590949c2a..ad9ae4992 100644 --- a/resources/templates/log4j2.xml +++ b/resources/templates/log4j2.xml @@ -6,19 +6,19 @@ - + %d{yyyy-MM-dd HH:mm:ss.SSS} %-5p %-4L %c{1} - %m{nolookups}%n - + - + %d{yyyy-MM-dd HH:mm:ss.SSS} %-5p %-4L %c{1} - %m{nolookups}%n @@ -26,56 +26,83 @@ - + - + %d{yyyy-MM-dd HH:mm:ss.SSS} %-8sn %-5p %-16marker <%t> %c{1}: %msg{nolookups}%n - + - + + %d{yyyy-MM-dd HH:mm:ss.SSS} %-8sn %-5p %-16marker <%t> %c{1}: %msg{nolookups}%n + + + + + + + + + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} - %m{nolookups}%n + + - + - + - - + + + - - + + + + + + + + + + @@ -141,6 +169,7 @@ + @@ -160,14 +189,19 @@ - - + + + + + + + @@ -176,7 +210,7 @@ - + @@ -220,7 +254,7 @@ - + @@ -306,6 +340,10 @@ + + + + diff --git a/src/commands/node.mjs b/src/commands/node.mjs index 1bd3938fa..f432e55f5 100644 --- a/src/commands/node.mjs +++ b/src/commands/node.mjs @@ -91,7 +91,7 @@ export class NodeCommand extends BaseCommand { async checkNetworkNodeState (nodeId, maxAttempt = 100, status = 'ACTIVE') { nodeId = nodeId.trim() const podName = Templates.renderNetworkPodName(nodeId) - const logfilePath = `${constants.HEDERA_HAPI_PATH}/logs/hgcaa.log` + const logfilePath = `${constants.HEDERA_HAPI_PATH}/output/hgcaa.log` let attempt = 0 let isActive = false @@ -131,8 +131,8 @@ export class NodeCommand extends BaseCommand { // ls the HAPI path for debugging await this.k8.execContainer(podName, constants.ROOT_CONTAINER, `ls -la ${constants.HEDERA_HAPI_PATH}`) - // ls the logs directory for debugging - await this.k8.execContainer(podName, constants.ROOT_CONTAINER, `ls -la ${constants.HEDERA_HAPI_PATH}/logs`) + // ls the output directory for debugging + await this.k8.execContainer(podName, constants.ROOT_CONTAINER, `ls -la ${constants.HEDERA_HAPI_PATH}/output`) } attempt += 1 await sleep(1000) @@ -1485,7 +1485,7 @@ export class NodeCommand extends BaseCommand { subTasks.push({ title: `Start node: ${chalk.yellow(nodeId)}`, task: async () => { - await this.k8.execContainer(podName, constants.ROOT_CONTAINER, ['bash', '-c', `rm -f ${constants.HEDERA_HAPI_PATH}/logs/*`]) + await this.k8.execContainer(podName, constants.ROOT_CONTAINER, ['bash', '-c', `rm -rf ${constants.HEDERA_HAPI_PATH}/output/*`]) // copy application.env file if required if (config.applicationEnv) {