TimRepke / registration-system

Planungssystem für Gruppenfahrten
GNU General Public License v3.0
1 stars 0 forks source link

PHP syslog() to docker log #53

Open TimRepke opened 7 years ago

TimRepke commented 7 years ago

Momentan, wenn man docker-compose up macht (ohne deamonize) bekommt man den access log direkt auf die Konsole. Es wäre toll, wenn man PHP syslog() direkt auch darauf bekommt. In der /etc/php5/php-fpm.conf ist das logfile dafür gesetzt und folgendes klappt:

$ docker exec -i -t registrationsystem_web_1 bash
# tail -f /var/log/php-fpm.log

Es ist irgendwie möglich das auf syslog zu lenken [2,3], beste wäre, wenn das direkt auch mit in den oberen log gepampst wird. Außerdem müllt die start.sh in die config dauernd [4]!!

[1] http://php.net/manual/de/function.syslog.php [2] https://ma.ttias.be/hide-php-errors-and-log-them-to-a-file-or-syslog-php-fpm-or-mod_php/ [3] https://github.com/docker-library/php/issues/140 [4] https://github.com/ngineered/nginx-php-fpm/blob/8137d2d0c5e1b9afa36ba2781a027184dc46ad4b/scripts/start.sh#L65

TimRepke commented 7 years ago

Ach ja, und container starten macht auch ein chown irgendwo auf libuuid. Alle Datein im Ordner gehören auf einmal dem user und der gruppe libuuid und man muss es per hand zurücksetzen.

elpado commented 7 years ago

Hallo,

stehe vor dem selben Problem. Error Logs gehen direkt an das syslog, zumindest habe ich php-fpm so konfiguriert. Nach der Aktivierung von catch_worker_output klappt das auch soweit.

Allerdings landen keine Einträge im Docker log wenn ich aus dem PHP Script syslog aufrufe.

Gibt es dafür eine Lösung?

TimRepke commented 7 years ago

Hi @elpado , wir haben diesbezüglich keine weiteren Fortschritte gemacht leider. Es scheint irgendwie ein Docker Problem zu sein, was @0x17de vielleicht besser lösen kann.

0x17de commented 7 years ago

Ich schaue mir das mal an. Gebe bescheid :)

0x17de commented 7 years ago

@elpado Kannst auch testen, ob der branch feature-php-syslog deine Wünsche erfüllt.

elpado commented 7 years ago

Habe es nun insofern gelöst als das ich /dev/log in den Container mounte, also

-v /dev/log:/dev/log

Damit klappt es nun. Ist aber immo nur ein Workaround.