Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion geth/geth-entrypoint
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
#!/bin/bash
set -eu

VERBOSITY=${GETH_VERBOSITY:-3}
# GETH_VERBOSITY sets the numeric log level (0=crit, 1=error, 2=warn, 3=info, 4=debug, 5=trace)
# LOG_LEVEL accepts human-readable aliases and takes precedence when set
if [[ -n "${LOG_LEVEL:-}" ]]; then
case "$LOG_LEVEL" in
"error") VERBOSITY=1 ;;
"warn") VERBOSITY=2 ;;
"info") VERBOSITY=3 ;;
"debug") VERBOSITY=4 ;;
"trace") VERBOSITY=5 ;;
*)
echo "Invalid LOG_LEVEL: $LOG_LEVEL. Valid values: error, warn, info, debug, trace" 1>&2
exit 1
;;
esac
else
VERBOSITY=${GETH_VERBOSITY:-3}
fi
GETH_DATA_DIR=${GETH_DATA_DIR:-/data}
RPC_PORT="${RPC_PORT:-8545}"
WS_PORT="${WS_PORT:-8546}"
Expand Down
18 changes: 17 additions & 1 deletion nethermind/nethermind-entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,23 @@ set -eu

# Default configurations
NETHERMIND_DATA_DIR=${NETHERMIND_DATA_DIR:-/data}
NETHERMIND_LOG_LEVEL=${NETHERMIND_LOG_LEVEL:-Info}
# NETHERMIND_LOG_LEVEL accepts Nethermind log levels: Trace, Debug, Info, Warn, Error
# LOG_LEVEL accepts human-readable aliases and takes precedence when set
if [[ -n "${LOG_LEVEL:-}" ]]; then
case "$LOG_LEVEL" in
"error") NETHERMIND_LOG_LEVEL="Error" ;;
"warn") NETHERMIND_LOG_LEVEL="Warn" ;;
"info") NETHERMIND_LOG_LEVEL="Info" ;;
"debug") NETHERMIND_LOG_LEVEL="Debug" ;;
"trace") NETHERMIND_LOG_LEVEL="Trace" ;;
*)
echo "Invalid LOG_LEVEL: $LOG_LEVEL. Valid values: error, warn, info, debug, trace" 1>&2
exit 1
;;
esac
else
NETHERMIND_LOG_LEVEL=${NETHERMIND_LOG_LEVEL:-Info}
fi

RPC_PORT="${RPC_PORT:-8545}"
WS_PORT="${WS_PORT:-8546}"
Expand Down
4 changes: 2 additions & 2 deletions reth/reth-entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ case "$LOG_LEVEL" in
LOG_LEVEL="vvvvv"
;;
*)
echo "Unknown log level: $LOG_LEVEL"
LOG_LEVEL="vvv"
echo "Invalid LOG_LEVEL: $LOG_LEVEL. Valid values: error, warn, info, debug, trace" 1>&2
exit 1
;;
esac

Expand Down