Want to subscribe to topics you're interested in?
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

    917
    190
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +363
    Local Time:
    5:20 AM
    Latest
    Latest
    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

    58,894
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    6:20 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    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.