Skip to content

Commit

Permalink
Merge branch 'GDO-907' into 'master'
Browse files Browse the repository at this point in the history
GDO-907: Prepend Tail Output with Logfile Name

Closes GDO-907

See merge request devops-program/docker-builds!512
  • Loading branch information
erikostien-pingidentity committed Aug 2, 2021
2 parents c63f615 + 90125f9 commit 0833738
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pingcommon/opt/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ if test -z "${1}" -o "$1" = "start-server"; then

if test -n "${TAIL_LOG_FILES}"; then
echo "Tailing log files (${TAIL_LOG_FILES})"
# Word-split is expected behavior for $TAIL_LOG_FILES. Disable shellcheck.
# shellcheck disable=SC2086
exec tail -F ${TAIL_LOG_FILES} 2> /dev/null &
for log_file in ${TAIL_LOG_FILES}; do
tail -F "${log_file}" 2> /dev/null | awk -v prepend="${log_file}" '{ print prepend ": " $0 }' &
done
fi

# If a command is provided after the "start-server" on the container start, then
Expand Down

0 comments on commit 0833738

Please sign in to comment.