Apache log format

Discussion in 'Installation/Configuration' started by Z3r0h0ur, May 25, 2018.

  1. Z3r0h0ur

    Z3r0h0ur New Member

    Hello!
    How can I change apache log format for all virtual hosts at once?
    ooo-default.conf
    Code:
    CustomLog ${APACHE_LOG_DIR}/access.log vhost_combined
    
    default-ssl.conf
    Code:
    CustomLog ${APACHE_LOG_DIR}/access.log vhost_combined
    and I am still getting logs without %v
    Code:
    157.55.39.33 - - [25/May/2018:15:57:18 +0300] "GET /robots.txt HTTP/1.1" 200 5298 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)"
    I can achieve that only by modifying each site.vconf, but I would like to make a change for all vhosts
    Thanks
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    See Apache ispconfig.conf file, but ensure that your new format is compatible with vlogger.
     
  3. Z3r0h0ur

    Z3r0h0ur New Member

    Thanks till
    This is from ispconfig.conf file
    Code:
    LogFormat "%v %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
    
     
  4. Z3r0h0ur

    Z3r0h0ur New Member

    apache.conf file does not contain that line. Should I add it ?
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    No, why do you want to add it, the ispconfig.conf file is included into the apache configuration already.
     
  6. Z3r0h0ur

    Z3r0h0ur New Member

    I see.
    I just don't get why this
    Code:
    LogFormat "%v %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
    CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m%d-access.log\" /var/log/ispconfig/httpd" combined_ispconfig env=!dontlog
    
    in ispconfg.conf, is not outputting the log in defined format.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    The log is processed by vlogger, so the format that ISPConfig defines there is the format that vlogger requires as input format.
     
  8. Z3r0h0ur

    Z3r0h0ur New Member

    OK. is there a way to edit vlogger output format ? Thanks
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Take a look at the vlogger code, it's a perl program.
     

Share This Page