Learn about Centmin Mod LEMP Stack today
Become a Member

Nginx PHP-FPM Access logs not updating?

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by joshuah, Jun 2, 2017.

  1. joshuah

    joshuah Member

    Apr 3, 2017
    Local Time:
    6:25 PM
    I am just wondering is there a certain delay for access.log to be updated?

    tailf /home/nginx/domains/*/log/access.log
    The above command is showing an hour delay from last activity.. i have several websites all with some traffic.. in fact, i am hitting several of the websites and individual files etc. but the log still does not show any recent activity.

    Any ideas?

    Thank you.
  2. eva2000

    eva2000 Administrator Staff Member

    May 24, 2014
    Brisbane, Australia
    Local Time:
    6:25 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Centmin Mod for performance reasons buffers access_log writes see http://nginx.org/en/docs/http/ngx_http_log_module.html so if you do a nginx restart it will flush buffered in memory logs to access log file

    in vhosts config file i.e. domain.com.conf
    Code (Text):
      access_log /home/nginx/domains/domain1.com/log/access.log combined buffer=256k flush=60m;

    if you want to remove it edit and remove to
    Code (Text):
      access_log /home/nginx/domains/domain1.com/log/access.log combined;

    restart nginx server

    also centmin mod doesn't log static file requests in common include file for each vhost at /usr/local/nginx/conf/staticfiles.conf

    you see each location context match as
    Code (Text):
    access_log off;

    You can comment that out to re-enabling logging
    Code (Text):
    #access_log off;

    restart nginx server