Temporary log format change
Hello!
I need to change for temporary period log format for single domain with subdomains. I have seen that on httpd.conf there are lines for domain and subdomains.
When opening the api.dev.domain.com-bytes_log I have found that this is not right access log for me because of it's format. Regarding this I have the following questions: 1) If I add additional CustomLog directive will it write addtitional log if I run /usr/local/cpanel/bin/apache_conf_distiller --update 2) Are there something bad can happen if I add the log format for single domain including subdomains? 3) I need to add milliseconds for log format. Will it work if I add to log line msec_frac?
Thank you!
CustomLog /usr/local/apache/domlogs/api.dev.domain.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."When opening the api.dev.domain.com-bytes_log I have found that this is not right access log for me because of it's format. Regarding this I have the following questions: 1) If I add additional CustomLog directive will it write addtitional log if I run /usr/local/cpanel/bin/apache_conf_distiller --update 2) Are there something bad can happen if I add the log format for single domain including subdomains? 3) I need to add milliseconds for log format. Will it work if I add to log line msec_frac?
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %{CF-Connecting-IP}i -%{msec_frac}t" combinedThank you!
-
Hello, You can make the change for a single VirtualHost using the instructions at: Modify Apache Virtual Hosts with Include Files - EasyApache 4 - cPanel Documentation Or, if you are using EasyApache 3: Advanced Apache Configuration - EasyApache - cPanel Documentation An error will occur if there's invalid syntax when running "/scripts/rebuildhttpdconf". Information on custom Log format configuration is available at: mod_log_config - Apache HTTP Server Version 2.4 Let us know if this helps. Thank you. 0 -
Hello! Cpanel / Apache ignores custom log format. I have created a file on: /usr/local/apache/conf/userdata/std/2_4/domain/domain.com/domain.com.conf which contains the folowing lines: LogFormat "%V %a %l %u %{%d/%b/%Y %T}t.%{msec_frac}t %{%z}t \"%r\" %s %b \"%{Referer}i\" \"%{User-agent}i\"" combined CustomLog /usr/local/apache/domlogs/domain.com.log combined
also this oneLogFormat "%{%d/%b/%Y %T}t.%{msec_frac}t %{%z}t" combined CustomLog /usr/local/apache/domlogs/domain.com.log combined
After each modification I have made "/scripts/rebuildhttpdconf" and "/scripts/restartsrv_httpd" without errors. After that the custom log is generated on specified location, but the log format is not changed. Why custom format is ignored?0 -
I have made the following changes to file CustomLog /usr/local/apache/domlogs/domain.com.log "%V %a %l %u %{%d/%b/%Y %T}t.%{msec_frac}t %{%z}t \"%r\" %s %b \"%{Referer}i\" \"%{User-agent}i\""
And this worked for me. Thanks!0 -
I'm happy to see it worked well. Thank you for updating us with the outcome. 0
Please sign in to leave a comment.
Comments
4 comments