Hi guys! How do you configure spryker in docker to...
# docker
a
Hi guys! How do you configure spryker in docker to send the log from yves and zed directly to the stdout? They are directly sent to Kibana. I currently have:
Copy code
$config[LogConstants::LOG_FILE_PATH_YVES] = '<php://stdout>';
$config[LogConstants::LOG_FILE_PATH_ZED] = '<php://stdout>';
$config[LogConstants::EXCEPTION_LOG_FILE_PATH_YVES] = '<php://stderr>';
$config[LogConstants::EXCEPTION_LOG_FILE_PATH_ZED] = '<php://stderr>';
$config[QueueConstants::QUEUE_WORKER_OUTPUT_FILE_NAME] = '<php://stdout>';
And in php-fpm I set:
Copy code
php_admin_value[error_log] = /proc/self/fd/2
I see the errors in Zed, but not in Yves. Anyone has figured this out?
h
Copy code
<php://stdout>
Won’t work at all. As php-fpm does not support proxying to /proc/self/fd/1. So only /proc/self/fd/2 and php://stderr would work.
s
We are using a Filebeat companion container for this.
r
we're using a file with symlink like nginx does in their official image: https://docs.docker.com/config/containers/logging/
h
@rapid-diamond-82606 I would like to ask the details… The problem I face is that php-fpm worker cannot access neither /proc/1/fd/2 or /dev/stderr. So symlink does not work.
r
@high-pencil-62400 good to know - we wanted to switch to symlink because our solution is not that nice current solution is that we create a fifo file that we use as log destination. In our entrypoint, we use:
mkfifo /var/log/stdout
chmod 666 /var/log/stdout
and in the Spryker config, we use /var/log/stdout as log destination
h
How do you create a link?
r
well, this solution is without link, that's why I said not so nice
h
Ok. How do you redirect /var/log/stdout into docker container output?
r
it's a fifo file. If I get it right, it's content is automatically posted into stdout
ah, we tail it via supervisord
command=tail -f /var/log/stdout
as I said, not that nice
h
Ok. That explains.
Symlink does not work. As worker has no permission to write into php-fpm process output.
r
thx for that information - I wanted to switch to symlink soon
h
However
<php://stderr>
works properly. The only thing to do is to set the following for php-fpm pool
Copy code
catch_workers_output = yes
decorate_workers_output = no
At that point it works properly.
But console commands are different case. We are trying to find a way to redirect logs spawned by scheduled console commands (e.g. Jenkins) into container output.
r
that's still an open point in our setup
h
I will notify you about our solution when it becomes mature.
👍 1
r
so in php 7.3 php://stdout should work
h
Yep. I’ve already mentioned the
decorate_workers_output = no
So web requests are good. CLI is still not clear.