A containerised application writing to /var/log/app.log has written to a filesystem that disappears with the container, and nothing outside can see it. The convention is that a container logs to stdout and stderr, and the platform decides where that goes.
# the official images do this by symlinking
RUN ln -sf /dev/stdout /var/log/nginx/access.log
&& ln -sf /dev/stderr /var/log/nginx/error.log
# PHP-FPM
RUN sed -i 's|;error_log = .*|error_log = /proc/self/fd/2|' /usr/local/etc/php-fpm.conf
It is a contract rather than a preference: docker logs, log drivers and every aggregator downstream assume it. The one gotcha is buffering — a process that buffers stdout when it is not a terminal will appear to log nothing until it exits, which is why so many entrypoints set an unbuffered flag. PHP-FPM needs its access log pointed at the same place separately, or you get errors and no requests.