File tree Expand file tree Collapse file tree 4 files changed +36
-10
lines changed Expand file tree Collapse file tree 4 files changed +36
-10
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ function restore_resolvconf() {
1919
2020# # Start and configure dnsmasq
2121function dnsmasq_start() {
22- echo " Found Webserver IP: $1 "
22+ echo " [dnsmasq] Found Webserver IP: $1 "
2323
2424 restore_resolvconf
2525
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -o pipefail # trace ERR through pipes
4+ set -o errtrace # trace ERR through 'time command' and other functions
5+ set -o nounset # # set -u : exit the script if you try to use an uninitialised variable
6+ set -o errexit # # set -e : exit the script if any statement returns a non-true return value
7+
8+ tail -F --quiet $2 | sed --unbuffered -e " s/^/\[$1 \] /"
Original file line number Diff line number Diff line change @@ -19,8 +19,26 @@ stdout_logfile_maxbytes=0
1919stderr_logfile=/dev/stderr
2020stderr_logfile_maxbytes=0
2121
22- [program:php-log]
23- command = tail -F --quiet /tmp/php.log
22+ [program:php-log-access]
23+ command = bash /opt/docker/logwatch.sh php:access /tmp/php.access.log
24+ autostart = true
25+ autorestart = true
26+ stdout_logfile=/dev/stdout
27+ stdout_logfile_maxbytes=0
28+ stderr_logfile=/dev/stderr
29+ stderr_logfile_maxbytes=0
30+
31+ [program:php-log-slow]
32+ command = bash /opt/docker/logwatch.sh php:slow /tmp/php.slow.log
33+ autostart = true
34+ autorestart = true
35+ stdout_logfile=/dev/stdout
36+ stdout_logfile_maxbytes=0
37+ stderr_logfile=/dev/stderr
38+ stderr_logfile_maxbytes=0
39+
40+ [program:php-log-error]
41+ command = bash /opt/docker/logwatch.sh php:error /tmp/php.error.log
2442autostart = true
2543autorestart = true
2644stdout_logfile=/dev/stdout
Original file line number Diff line number Diff line change @@ -44,10 +44,10 @@ if [ ! -f "/opt/docker/.fpm-www.conf" ]; then
4444 cp /etc/php5/fpm/pool.d/www.conf /opt/docker/.fpm-www.conf
4545fi
4646
47- # # init log
48- rm -f -- /tmp/php.log
49- touch /tmp/php.log
50- chmod 666 /tmp/php.log
47+ # # Remove old logs
48+ rm -f -- /tmp/php.access.log /tmp/php.slow.log /tmp/php.error. log
49+ touch -- /tmp/php.access.log /tmp/php.slow.log /tmp/php.error .log
50+ chmod 666 /tmp/php.access.log /tmp/php.slow.log /tmp/php.error. log
5151
5252# Restore original
5353cp /opt/docker/.fpm-www.conf /etc/php5/fpm/pool.d/www.conf
@@ -64,11 +64,11 @@ pm.max_spare_servers = 3
6464
6565catch_workers_output = yes
6666
67- access.log = /tmp/php.log
68- slowlog = /tmp/php.log
67+ access.log = /tmp/php.access. log
68+ slowlog = /tmp/php.slow. log
6969request_slowlog_timeout = 10s
7070
71- php_admin_value[error_log] = /tmp/php.log
71+ php_admin_value[error_log] = /tmp/php.error. log
7272php_admin_flag[log_errors] = on
7373
7474env[TYPO3_CONTEXT] = ${TYPO3_CONTEXT}
You can’t perform that action at this time.
0 commit comments