chore(config): Change default log_to config

By default log to file.
When start from console or forgreground, only log to console.
Only log to file for package builds.
This commit is contained in:
Zaiming Shi 2021-03-02 12:37:49 +01:00
parent 2fb5dbd546
commit 6b2949e2c1
3 changed files with 10 additions and 3 deletions

View File

@ -518,6 +518,9 @@ case "$1" in
;;
esac
# set before generate_config
export EMQX_LOG__TO='console'
#generate app.config and vm.args
generate_config
@ -534,7 +537,8 @@ case "$1" in
# shellcheck disable=SC2086 # $RELX_CONFIG_PATH $CONFIG_ARGS $EPMD_ARG are supposed to be split by whitespace
# Build an array of arguments to pass to exec later on
# Build it here because this command will be used for logging.
set -- "$BINDIR/erlexec" -boot "$BOOTFILE" -mode "$CODE_LOADING_MODE" \
set -- "$BINDIR/erlexec" \
-boot "$BOOTFILE" -mode "$CODE_LOADING_MODE" \
-boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
-mnesia dir "\"${MNESIA_DATA_DIR}\"" \
$RELX_CONFIG_PATH $CONFIG_ARGS $EPMD_ARG
@ -557,6 +561,9 @@ case "$1" in
# start up the release in the foreground for use by runit
# or other supervision services
# set before generate_config
export EMQX_LOG__TO='console'
#generate app.config and vm.args
generate_config

View File

@ -412,7 +412,7 @@ rpc.socket_buffer = 1MB
## - file: write logs only to file
## - console: write logs only to standard I/O
## - both: write logs both to file and standard I/O
log.to = both
log.to = file
## The log severity level.
##

View File

@ -449,7 +449,7 @@ end}.
%%--------------------------------------------------------------------
{mapping, "log.to", "kernel.logger", [
{default, console},
{default, file},
{datatype, {enum, [off, file, console, both]}}
]}.