<p><strong>Edit:</strong> Since I'm seeing the downvotes and I understand them, will clarify: The app wasn't logging the standard way and wasn't my call to change that. Also, as a newbie at k8s back then, didn't know how to pick up other files. Devs couldn't change that (can't remember why) but I did manage to pick up the files with something like fluentD/bit. Sorry for the misunderstanding.</p>
<p>I have a pod with 2 containers: nginx and php-fpm.
I'm tyring to get the php-fpm logs (that do log to the container) to stdout so I can see them at kibana.</p>
<p>Here's some info form inside the php-fpm container:</p>
<pre><code>#env | grep -i log
APP_LOG_PATH=php://stdout

# php -i | grep -i log
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.17, Copyright (c) 1999-2018, by Zend Technologies
amqp.login =&gt; guest =&gt; guest
error_log =&gt; no value =&gt; no value
log_errors =&gt; Off =&gt; Off
log_errors_max_len =&gt; 1024 =&gt; 1024
mail.log =&gt; no value =&gt; no value
com_binlog_dump =&gt; 0
Classes =&gt; AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, CallbackFilterIterator, DirectoryIterator, DomainException, EmptyIterator, FilesystemIterator, FilterIterator, GlobIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, MultipleIterator, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveCallbackFilterIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RecursiveTreeIterator, RegexIterator, RuntimeException, SplDoublyLinkedList, SplFileInfo, SplFileObject, SplFixedArray, SplHeap, SplMinHeap, SplMaxHeap, SplObjectStorage, SplPriorityQueue, SplQueue, SplStack, SplTempFileObject, UnderflowException, UnexpectedValueException
opcache.error_log =&gt; no value =&gt; no value
opcache.log_verbosity_level =&gt; 1 =&gt; 1
APP_LOG_PATH =&gt; php://stdout
$_SERVER['APP_LOG_PATH'] =&gt; php://stdout
$_ENV['APP_LOG_PATH'] =&gt; php://stdout
Segmentation fault (core dumped)
# 
</code></pre>
<p>Tried to uncomment this at www.conf (that's where the logs go):</p>
<pre><code>php_admin_value[error_log] = /var/www/html/logs/my-app.log
php_admin_flag[log_errors] = on
</code></pre>
<p>The only thing I could get is related to the process, like &quot;was restarted&quot; &quot;initiated&quot; etc.</p>
<p>I restarted php with:</p>
<pre><code>kill -USR2 1
</code></pre>
<p>But can't get log_errors =&gt; on =&gt; on after doing that.</p>
<p>Any help would be great, thanks!</p>

Rancor
<p>Set <code>error_log = /dev/stdout</code>, <code>access.log = /dev/stdout</code>, and <code>log_level</code> to which ever level you need in the main php-fpm configuration file. Possibly at <code>/etc/php/7.2/fpm/php-fpm.conf</code> or elsewhere depending on your parent docker image.</p>

<p><a href="https://secure.php.net/manual/en/install.fpm.configuration.php" rel="nofollow noreferrer">Documentation Reference</a></p>
