docker
docker copied to clipboard
How to disable apache's access log?
Is it possible to disable apache's access log? so many lines per second like this
app_1 | 192.168.0.2 - - [02/Jan/2022:10:12:40 +0000] "GET /login HTTP/1.1" 200 6862 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"
app_1 | 192.168.0.2 - - [02/Jan/2022:10:12:40 +0000] "GET /core/img/favicon.ico HTTP/1.1" 200 3809 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"
app_1 | 127.0.0.1 - - [02/Jan/2022:10:12:47 +0000] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.51 (Debian) PHP/8.0.13 (internal dummy connection)"
app_1 | 127.0.0.1 - - [02/Jan/2022:10:12:48 +0000] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.51 (Debian) PHP/8.0.13 (internal dummy connection)"
app_1 | 192.168.0.2 - - [02/Jan/2022:10:12:40 +0000] "GET /cron.php HTTP/1.1" 200 931 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"
app_1 | 127.0.0.1 - - [02/Jan/2022:10:12:57 +0000] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.51 (Debian) PHP/8.0.13 (internal dummy connection)"
This image is based on https://github.com/docker-library/php. You are more likely to find an answer there.
From this issue: https://github.com/docker-library/php/issues/537
There is no explicit setting in Apache's config but the files in /var/log/apache2/* are symlinked to stdout and stderr.
Just delete the symlink(s) or point the access/error log to another file.
lrwxrwxrwx 1 www-data www-data 11 Mar 1 19:20 access.log -> /dev/stdout
lrwxrwxrwx 1 www-data www-data 11 Mar 1 19:20 error.log -> /dev/stderr
lrwxrwxrwx 1 www-data www-data 11 Mar 1 19:20 other_vhosts_access.log -> /dev/stdout