Learn about Centmin Mod LEMP Stack today
Become a Member

How to change default log files to /var/log/nginx/

Discussion in 'Install & Upgrades or Pre-Install Questions' started by EckyBrazzz, Oct 29, 2019.

Tags:
  1. EckyBrazzz

    EckyBrazzz Active Member

    747
    149
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +274
    Local Time:
    4:26 PM
    1.17.x Cluster
    10.3.x Cluster & Redis
    Now all our log files go to
    Code (Text):
    /home/nginx/domains/domainname.com/log/
    


    But I need them to be all together in a singel file in
    Code (Text):
    /var/log/nginx/


    Every time with Lsyncd they get overwritten by the master server on the target servers

    EDIT
    Found it *--exclude log

    But still need the in one log file because I scan them even week and send new bot to the bat bod. Now I have to create for every single domain a bash file and a cronjob
     
    Last edited: Oct 29, 2019
  2. eva2000

    eva2000 Administrator Staff Member

    42,078
    9,497
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,613
    Local Time:
    4:26 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    you mean all nginx vhost sites on server log all logs to a single file ? you can setup a separate access_log in nginx vhosts which all post to the same file Module ngx_http_log_module similar to how I setup custom Cloudflare Nginx logging at Cloudflare - Cloudflare custom Nginx logging. Then keep existing access_log in Nginx vhost so 2 logs, one for domain.com/log and one for /var/log/nginx.
     
    • Informative Informative x 1