mirror of
https://git.techniverse.net/scriptos/tmserver-docker.git
synced 2026-07-09 13:37:03 +00:00
Log-Rotation fuer Apache-, PHP- und XAseco-Logs eingerichtet
This commit is contained in:
@@ -1101,5 +1101,23 @@ elif [ "$XMLRPC_READY" = "true" ]; then
|
||||
echo "==> Forced Mods: Keine FORCE_MOD_*-Variablen gesetzt. Ueberspringe."
|
||||
fi
|
||||
|
||||
# ============================================================
|
||||
# Log-Rotation: Hintergrundprozess starten
|
||||
# ============================================================
|
||||
# logrotate wird stuendlich ausgefuehrt, um Apache-, PHP- und
|
||||
# XAseco-Logs groessenbasiert zu rotieren (max. 10 MB pro Datei,
|
||||
# 5 rotierte Dateien). Da im Container kein cron laeuft, wird
|
||||
# ein einfacher Background-Loop verwendet.
|
||||
# ============================================================
|
||||
echo "==> Starte Log-Rotation (stuendlich, groessenbasiert 10 MB)..."
|
||||
(
|
||||
while true; do
|
||||
sleep 3600
|
||||
/usr/sbin/logrotate /etc/logrotate.d/tmserver --state /tmp/logrotate.state
|
||||
done
|
||||
) &
|
||||
LOGROTATE_PID=$!
|
||||
echo " Log-Rotation gestartet (PID: ${LOGROTATE_PID})"
|
||||
|
||||
# Auf TrackmaniaServer warten (Hauptprozess)
|
||||
wait $TM_PID
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
# ============================================================
|
||||
# Log-Rotation fuer tmserver-docker
|
||||
# ============================================================
|
||||
# Wird stuendlich per Background-Loop ausgefuehrt.
|
||||
# Rotation: groessenbasiert (10 MB), max. 5 rotierte Dateien.
|
||||
# ============================================================
|
||||
|
||||
# Apache Access- und Error-Log
|
||||
/var/log/apache2/access.log
|
||||
/var/log/apache2/error.log
|
||||
{
|
||||
size 10M
|
||||
rotate 5
|
||||
missingok
|
||||
notifempty
|
||||
compress
|
||||
delaycompress
|
||||
copytruncate
|
||||
}
|
||||
|
||||
# PHP Error-Log
|
||||
/var/log/php_errors.log
|
||||
{
|
||||
size 10M
|
||||
rotate 5
|
||||
missingok
|
||||
notifempty
|
||||
compress
|
||||
delaycompress
|
||||
copytruncate
|
||||
}
|
||||
|
||||
# XAseco-Log (liegt im persistenten Volume)
|
||||
/opt/tmserver/xaseco/aseco.log
|
||||
{
|
||||
size 10M
|
||||
rotate 5
|
||||
missingok
|
||||
notifempty
|
||||
compress
|
||||
delaycompress
|
||||
copytruncate
|
||||
}
|
||||
|
||||
# AdminServ-Logs (liegen im persistenten Volume)
|
||||
/var/www/html/logs/*.log
|
||||
{
|
||||
size 10M
|
||||
rotate 5
|
||||
missingok
|
||||
notifempty
|
||||
compress
|
||||
delaycompress
|
||||
copytruncate
|
||||
}
|
||||
Reference in New Issue
Block a user