LOG_FILE_PATH => LOG_FILE

This commit is contained in:
Roy Crihfield 2023-09-29 03:30:30 +08:00
parent 449ce373cc
commit f47336825d
4 changed files with 7 additions and 7 deletions

View File

@ -43,7 +43,7 @@ jobs:
DATABASE_TYPE: postgres
LEVELDB_PATH: ./fixture/chaindata
LEVELDB_ANCIENT: ./fixture/chaindata/ancient
LOG_FILE_PATH: ./server-log
LOG_FILE: ./server-log
timeout-minutes: 30
run: |
./eth-statediff-service --config ./test/ci-config.toml serve &

View File

@ -58,8 +58,8 @@ const (
PRERUN_INCLUDE_TD = "PRERUN_INCLUDE_TD"
PRERUN_INCLUDE_CODE = "PRERUN_INCLUDE_CODE"
LOG_LEVEL = "LOG_LEVEL"
LOG_FILE_PATH = "LOG_FILE_PATH"
LOG_LEVEL = "LOG_LEVEL"
LOG_FILE = "LOG_FILE"
DATABASE_NAME = "DATABASE_NAME"
DATABASE_HOSTNAME = "DATABASE_HOSTNAME"
@ -145,7 +145,7 @@ func init() {
viper.BindEnv("prerun.params.includeCode", PRERUN_INCLUDE_CODE)
viper.BindEnv("log.level", LOG_LEVEL)
viper.BindEnv("log.file", LOG_FILE_PATH)
viper.BindEnv("log.file", LOG_FILE)
viper.BindEnv("debug.pprof", DEBUG_PPROF)
}

View File

@ -42,7 +42,7 @@
[log]
# Leave empty to output to stdout
file = "" # LOG_FILE_PATH
file = "" # LOG_FILE
level = "info" # LOG_LEVEL
[database]

View File

@ -31,8 +31,8 @@ fi
START_TIME=`date -u +"%Y-%m-%dT%H:%M:%SZ"`
echo "Running the statediff service" && \
if [[ ! -z "$LOG_FILE_PATH" ]]; then
$SETUID /app/eth-statediff-service "$VDB_COMMAND" --config=/app/config.toml $* |& $SETUID tee ${LOG_FILE_PATH}.console
if [[ ! -z "$LOG_FILE" ]]; then
$SETUID /app/eth-statediff-service "$VDB_COMMAND" --config=/app/config.toml $* |& $SETUID tee ${LOG_FILE}.console
rc=$?
else
$SETUID /app/eth-statediff-service "$VDB_COMMAND" --config=/app/config.toml $*