Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix] multiple sys_log_to_console=true entry in fe.conf every time… (backport #45851) #51160

Merged
merged 2 commits into from
Sep 19, 2024
Merged
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
5 changes: 2 additions & 3 deletions bin/start_fe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RUN_DAEMON=0
HELPER=
HOST_TYPE=
ENABLE_DEBUGGER=0
RUN_LOG_CONSOLE=0
RUN_LOG_CONSOLE=${SYS_LOG_TO_CONSOLE:-0}
while true; do
case "$1" in
--daemon) RUN_DAEMON=1 ; shift ;;
Expand Down Expand Up @@ -231,12 +231,11 @@ if [ ${RUN_LOG_CONSOLE} -eq 1 ] ; then
mv $STARROCKS_HOME/conf/fe.conf $STARROCKS_HOME/conf/fe.conf.readonly
cp $STARROCKS_HOME/conf/fe.conf.readonly $STARROCKS_HOME/conf/fe.conf
fi
# force sys_log_to_console = true
echo -e "\nsys_log_to_console = true" >> $STARROCKS_HOME/conf/fe.conf
else
# redirect all subsequent commands' stdout/stderr into $LOG_FILE
exec >> $LOG_FILE 2>&1
fi
export SYS_LOG_TO_CONSOLE=${RUN_LOG_CONSOLE}

echo "using java version $JAVA_VERSION"
echo $final_java_opt
Expand Down
3 changes: 2 additions & 1 deletion fe/fe-core/src/main/java/com/starrocks/common/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ public class Config extends ConfigBase {
* Log to file by default. set to `true` if you want to log to console
*/
@ConfField
public static boolean sys_log_to_console = false;
public static boolean sys_log_to_console = ((System.getenv("SYS_LOG_TO_CONSOLE") != null)
? System.getenv("SYS_LOG_TO_CONSOLE").trim().equals("1") : false);

@ConfField(comment = "Log4j layout format. Valid choices: plaintext, json")
public static String sys_log_format = "plaintext";
Expand Down
Loading