Join the community 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

    115
    14
    18
    Apr 3, 2017
    Ratings:
    +16
    Local Time:
    11:25 AM
    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

    28,942
    6,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,751
    Local Time:
    11:25 AM
    Nginx 1.13.x
    MariaDB 5.5
    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