fix: Tail start offset should be lines + 1
0 or 1 is equivalent for a fresh file, but when log lines already exist, you want to start from the line after the last one, not at it. Thus always increment the count by 1.
This commit is contained in:
parent
4f1d075d43
commit
717bf7b434
|
@ -199,7 +199,7 @@ MAIN_LOGFILE=/var/log/mail/mail.log
|
|||
# NOTE: rsyslogd would usually create this later during `_start_daemons`, however it would already exist if the container was restarted.
|
||||
touch "${MAIN_LOGFILE}"
|
||||
# Ensure `tail` follows the correct position of the log file for this container start (new logs begin once `_start_daemons` is called)
|
||||
TAIL_START=$(wc -l < "${MAIN_LOGFILE}")
|
||||
TAIL_START=$(( $(wc -l < "${MAIN_LOGFILE}") + 1 ))
|
||||
|
||||
[[ ${LOG_LEVEL} =~ (debug|trace) ]] && print-environment
|
||||
_start_daemons
|
||||
|
|
Loading…
Reference in New Issue