From 122f5a7dafca451b1126fcd15532657a446b2cb4 Mon Sep 17 00:00:00 2001 From: mrekucci <4932785+mrekucci@users.noreply.github.com> Date: Thu, 28 Mar 2024 18:53:16 -0500 Subject: [PATCH] fix: include log tags option only if env variable is set --- geth-poa/entrypoint.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/geth-poa/entrypoint.sh b/geth-poa/entrypoint.sh index 866c642f37..e1fe3dc106 100644 --- a/geth-poa/entrypoint.sh +++ b/geth-poa/entrypoint.sh @@ -16,6 +16,12 @@ RPC_PORT="${RPC_PORT:-8545}" WS_PORT="${WS_PORT:-8546}" BLOCK_SIGNER_PRIVATE_KEY=${BLOCK_SIGNER_PRIVATE_KEY:-""} +if [ -n "$GETH_LOG_TAGS" ]; then + LOG_TAGS_OPTION="--log.tags=$GETH_LOG_TAGS" +else + LOG_TAGS_OPTION="" +fi + # Generate signer key if needed if [ "$GETH_NODE_TYPE" = "signer" ]; then if [ ! -f "$GETH_DATA_DIR/password" ]; then @@ -28,7 +34,7 @@ if [ "$GETH_NODE_TYPE" = "signer" ]; then "$GETH_BIN_PATH" \ --verbosity="$GETH_VERBOSITY" \ --log.format="$GETH_LOG_FORMAT" \ - --log.tags="$GETH_LOG_TAGS" \ + $LOG_TAGS_OPTION \ --nousb \ account import \ --datadir="$GETH_DATA_DIR" \ @@ -53,7 +59,7 @@ if [ ! -d "$GETH_CHAINDATA_DIR" ]; then "$GETH_BIN_PATH" \ --verbosity="$GETH_VERBOSITY" \ --log.format="$GETH_LOG_FORMAT" \ - --log.tags="$GETH_LOG_TAGS" \ + $LOG_TAGS_OPTION \ --nousb \ --state.scheme=path \ --db.engine=pebble \ @@ -88,7 +94,7 @@ if [ "$GETH_NODE_TYPE" = "bootnode" ]; then exec "$GETH_BIN_PATH" \ --verbosity="$GETH_VERBOSITY" \ --log.format="$GETH_LOG_FORMAT" \ - --log.tags="$GETH_LOG_TAGS" \ + $LOG_TAGS_OPTION \ --datadir="$GETH_DATA_DIR" \ --port 30301 \ --http \ @@ -130,7 +136,7 @@ elif [ "$GETH_NODE_TYPE" = "signer" ]; then exec "$GETH_BIN_PATH" \ --verbosity="$GETH_VERBOSITY" \ --log.format="$GETH_LOG_FORMAT" \ - --log.tags="$GETH_LOG_TAGS" \ + $LOG_TAGS_OPTION \ --datadir="$GETH_DATA_DIR" \ --port="$GETH_PORT" \ --syncmode="${GETH_SYNC_MODE}" \ @@ -180,7 +186,7 @@ elif [ "$GETH_NODE_TYPE" = "member" ]; then exec "$GETH_BIN_PATH" \ --verbosity="$GETH_VERBOSITY" \ --log.format="$GETH_LOG_FORMAT" \ - --log.tags="$GETH_LOG_TAGS" \ + $LOG_TAGS_OPTION \ --datadir="$GETH_DATA_DIR" \ --port="$GETH_PORT" \ --syncmode="${GETH_SYNC_MODE}" \