Skip to content

Commit

Permalink
Use ISO8601 date format in logs
Browse files Browse the repository at this point in the history
  • Loading branch information
mjnaderi committed Aug 24, 2024
1 parent 827e212 commit 812a16c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

log_with_timestamp() {
echo -e "$1" | awk '{ "date -Iseconds" | getline d; print d, $0 }'
echo -e "$1" | awk '{ "date -Iseconds" | getline d; print "["d"]", $0 }'
}

# Ensure the script is not run by the "root" user.
Expand Down Expand Up @@ -107,5 +107,5 @@ if [ -n "${SCHEDULE}" ]; then
exec supercronic "${HOME}/crontab"
else
log_with_timestamp "Running $1..."
exec "$@" 2>&1 | awk '{ "date -Iseconds" | getline d; print d, $0 }'
exec "$@" 2>&1 | awk '{ "date -Iseconds" | getline d; print "["d"]", $0 }'
fi
4 changes: 2 additions & 2 deletions server/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

log_with_timestamp() {
echo -e "$1" | awk '{ "date -Iseconds" | getline d; print d, $0 }'
echo -e "$1" | awk '{ "date -Iseconds" | getline d; print "["d"]", $0 }'
}

# Ensure the script is not run by the "root" user.
Expand Down Expand Up @@ -101,4 +101,4 @@ AllowUsers sshuser
################################
# Start sshd #
################################
exec /usr/sbin/sshd -D -e -f "${HOME}/sshd/sshd.conf" 2>&1 | awk '{ "date -Iseconds" | getline d; print d, $0 }'
exec /usr/sbin/sshd -D -e -f "${HOME}/sshd/sshd.conf" 2>&1 | awk '{ "date -Iseconds" | getline d; print "["d"]", $0 }'

0 comments on commit 812a16c

Please sign in to comment.