ByronHsu commented on a change in pull request #486:
URL: https://github.com/apache/submarine/pull/486#discussion_r551436894



##########
File path: bin/submarine.sh
##########
@@ -55,4 +55,4 @@ if [[ ! -d "${SUBMARINE_LOG_DIR}" ]]; then
   $(mkdir -p "${SUBMARINE_LOG_DIR}")
 fi
 
-exec $JAVA_RUNNER $JAVA_OPTS -cp ${SUBMARINE_SERVER_CLASSPATH} 
${SUBMARINE_SERVER_MAIN} "$@" >> "${SUBMARINE_SERVER_LOGFILE}" 2>&1
+exec $JAVA_RUNNER $JAVA_OPTS -cp ${SUBMARINE_SERVER_CLASSPATH} 
${SUBMARINE_SERVER_MAIN} "$@" | tee -a "${SUBMARINE_SERVER_LOGFILE}" 2>&1

Review comment:
       'kubectl logs' shows the stdout of the container in the pod. 
   The cause of server logs to be empty is that the container only direct the 
output to the log file. However, if we want to show the output by 'kubectl 
logs', we should direct it to stdout too.

##########
File path: bin/submarine.sh
##########
@@ -55,4 +55,4 @@ if [[ ! -d "${SUBMARINE_LOG_DIR}" ]]; then
   $(mkdir -p "${SUBMARINE_LOG_DIR}")
 fi
 
-exec $JAVA_RUNNER $JAVA_OPTS -cp ${SUBMARINE_SERVER_CLASSPATH} 
${SUBMARINE_SERVER_MAIN} "$@" >> "${SUBMARINE_SERVER_LOGFILE}" 2>&1
+exec $JAVA_RUNNER $JAVA_OPTS -cp ${SUBMARINE_SERVER_CLASSPATH} 
${SUBMARINE_SERVER_MAIN} "$@" | tee -a "${SUBMARINE_SERVER_LOGFILE}" 2>&1

Review comment:
       'kubectl logs' shows the stdout of the container in the pod. 
   The cause of server logs to be empty is that the container only direct the 
output to the log file. However, if we want to see the output by 'kubectl 
logs', we should direct it to stdout too.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to