Nginx - change error log rotation name

Discussion in 'Installation/Configuration' started by mislav, Dec 1, 2023.

  1. mislav

    mislav Member

    Hi everyone! I've a question in regards of the error.log rotation on the ispconfig nginx instances (OS is deb11, ISPConfig version is latest 3.2.x).
    Code:
    -rw-r--r--  1 root     root  23K Nov 22 00:02 20231120-access.log.gz
    -rw-r--r--  1 root     root  59K Nov 23 00:02 20231121-access.log.gz
    -rw-r--r--  1 root     root 122K Nov 24 00:02 20231122-access.log.gz
    -rw-r--r--  1 root     root  79K Nov 25 00:02 20231123-access.log.gz
    -rw-r--r--  1 root     root  27K Nov 26 00:02 20231124-access.log.gz
    -rw-r--r--  1 root     root  234 Nov 27 00:02 20231125-access.log.gz
    -rw-r--r--  1 root     root 4.1K Nov 28 00:02 20231126-access.log.gz
    -rw-r--r--  1 root     root  29K Nov 29 00:02 20231127-access.log.gz
    -rw-r--r--  1 root     root 4.5K Nov 30 00:02 20231128-access.log.gz
    -rw-r--r--  1 root     root 4.2K Dec  1 00:02 20231129-access.log.gz
    -rw-r--r--  1 www-data root 5.0K Nov 30 16:54 20231130-access.log
    -rw-r--r--  1 www-data root  13K Dec  1 10:13 access.log
    -rw-r--r--  1 www-data root    0 Dec  1 00:02 error.log
    -rw-r--r--  1 root     root  230 Nov 22 00:02 error.log.10.gz
    -rw-r--r--  1 root     root   30 Dec  1 00:02 error.log.1.gz
    -rw-r--r--  1 root     root   30 Nov 30 00:02 error.log.2.gz
    -rw-r--r--  1 root     root   30 Nov 29 00:02 error.log.3.gz
    -rw-r--r--  1 root     root   30 Nov 28 00:02 error.log.4.gz
    -rw-r--r--  1 root     root   30 Nov 27 00:02 error.log.5.gz
    -rw-r--r--  1 root     root   30 Nov 26 00:02 error.log.6.gz
    -rw-r--r--  1 root     root   30 Nov 25 00:02 error.log.7.gz
    -rw-r--r--  1 root     root   30 Nov 24 00:02 error.log.8.gz
    -rw-r--r--  1 root     root   30 Nov 23 00:02 error.log.9.gz
    
    So, based on the above format, I've found that access logs are created via cronjob script on daily basis:
    /usr/local/ispconfig/server/scripts/create_daily_nginx_access_logs.sh

    However, what I didn't find is the one for the error log. How are they being handled? And where?
    How can we configure output that it will also be in such format, e.g.
    20231128-error.log.gz
    20231129-error.log.gz

    I found something in
    /usr/local/ispconfig/server/lib/classes/cron.d/200-logfiles.inc.php

    However, this seems to be commented out.
    There is also something in the /usr/local/ispconfig/server/scripts/vlogger, but according to defaults there, it's not effective.
    Code:
    -t TEMPLATE
            Filename template using Date::Format codes.  Default is "%m%d%Y-access.log",
    or "%m%d%Y-error.log".  When using the -r option, the default becomes
    "%m%d%Y-%T-access.log" or "%m%d%Y-%T-error.log".
    
    Thanks upfront!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The code is in /usr/local/ispconfig/server/lib/classes/cron.d/200-logfiles.inc.php
     
    mislav likes this.
  3. mislav

    mislav Member

    Thanks @till
    Seems like editor was showing this as a comment, but in fact it's not. I've copied it to another one now and it's all good. Thank you!
     
    till likes this.

Share This Page