Discover Centmin Mod today
Register Now

Nginx PHP-FPM Access logs not updating?

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

  1. joshuah

    joshuah Member

    121
    14
    18
    Apr 3, 2017
    Ratings:
    +17
    Local Time:
    9:45 PM
    I am just wondering is there a certain delay for access.log to be updated?


    Code:
    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

    54,868
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    8:45 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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