Skip to content

Commit d1e409f

Browse files
committed
Added php log
1 parent 0296a9e commit d1e409f

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

docker/main/conf/supervisord.conf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,12 @@ stdout_logfile=/dev/stdout
1818
stdout_logfile_maxbytes=0
1919
stderr_logfile=/dev/stderr
2020
stderr_logfile_maxbytes=0
21+
22+
[program:php-log]
23+
command = tail -F --quiet /tmp/php.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

docker/main/entrypoint.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ if [ ! -f "/opt/docker/.fpm-www.conf" ]; then
4444
cp /etc/php5/fpm/pool.d/www.conf /opt/docker/.fpm-www.conf
4545
fi
4646

47+
## init log
48+
rm -f -- /tmp/php.log
49+
touch /tmp/php.log
50+
chmod 666 /tmp/php.log
51+
4752
# Restore original
4853
cp /opt/docker/.fpm-www.conf /etc/php5/fpm/pool.d/www.conf
4954
sed -i "s@listen = /var/run/php5-fpm.sock@listen = 9000@" /etc/php5/fpm/pool.d/www.conf
5055

51-
# FIXME
52-
# /etc/php5/fpm/php-fpm.conf
53-
# error_log = /proc/self/fd/2
54-
# issue: clients stdout isn't cathced by supervisord :(
55-
5656
# Manipulate php-fpm configuration
5757
echo "
5858
; Server resource settings
@@ -64,11 +64,11 @@ pm.max_spare_servers = 3
6464
6565
catch_workers_output = yes
6666
67-
access.log = /proc/self/fd/2
68-
slowlog = /proc/self/fd/2
69-
request_slowlog_timeout = 30s
67+
access.log = /tmp/php.log
68+
slowlog = /tmp/php.log
69+
request_slowlog_timeout = 10s
7070
71-
php_admin_value[error_log] = /proc/self/fd/2
71+
php_admin_value[error_log] = /tmp/php.log
7272
php_admin_flag[log_errors] = on
7373
7474
env[TYPO3_CONTEXT] = ${TYPO3_CONTEXT}
@@ -88,8 +88,8 @@ case "$1" in
8888
ETH0_IP=$(/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
8989
mkdir -p /data/dns/
9090
chmod 777 /data/dns/
91-
echo "${ETH0_IP}" > /data/dns/main.ip
92-
echo "${ETH0_IP} httpd httpd_1" > /data/dns/main.hosts
91+
echo "${ETH0_IP}" > /data/dns/main.ip
92+
echo "${ETH0_IP} main main_1" > /data/dns/main.hosts
9393

9494
## Start services
9595
exec supervisord

0 commit comments

Comments
 (0)