php - Docker: Logging From Both App and Server In One Container -


i want use centralized log catcher logentries, don't want agent running inside of containers. plan each service log container's stdout, passed logentries via docker api or logging container.

the question: how handle container needs output 2 logs? how keep them clean , separate without introducing logging mechanism?

the scenario: have php app, necessitates 3 components: nginx, php-fpm, , code. can put nginx , php-fpm in separate docker containers, they'll have separate logs, we're there. php has in same container nginx can served, right?
when app needs log (using monolog), can send stdout of container (e.g., make log file link /dev/stdout), can't keep logs nginx , app separate.

is there way that? or looking @ wrong? there better way run nginx + php in docker?

having not found better solution, ended having laravel/monolog log file in mounted volume. logentries agent collects log container's host. allows container remain clean possible in i'm not installing supervisor or logging agent, , allows whatever running container access log minimal effort.

logging stdout turned out not option because php-fpm wraps each line of output child process make difficult parse, , in case of json logs, entirely useless. (see https://groups.google.com/forum/#!topic/highload-php-en/vxdn8-ox9-m)


Popular posts from this blog