Append logs to file and rotate logs #43
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
As discussed in #31, this now logs the output of
/app/duck.sh
by appending to/config/duck.log
instead of overwriting it. A cronjob forlogrotate
is used to avoid excessive file sizes of the log file.Benefits of this PR and context:
When using
LOG_FILE=true
, the expectation is that it logs the history to a file instead of the current status.How Has This Been Tested?
I have tested logrotate in a local
docker-duckdns
image on macOS (M1) with a simulated largeduck.log
file.Source / References: