Apache Access Logs - Limit entries

General discussion on Zend Server for IBM System i
Post Reply
dani1879
Posts: 6
Joined: Thu Feb 05, 2015 8:14 pm

Apache Access Logs - Limit entries

Post by dani1879 » Wed Apr 05, 2017 6:55 pm

We are seeing these messages written to the Apache access logs every 30 seconds. How can I stop these messages from logging? Is there a way to disable them in Zend Server? We are running version 8.5.3.
127.0.0.1 - - [05/Apr/2017:13:36:24 -0400] "GET /UserServer/zsd_print_extensions.php HTTP/1.1" 200 3541 "-"
127.0.0.1 - - [05/Apr/2017:13:36:24 -0400] "GET /UserServer/zsd_is_webserver_alive.php HTTP/1.1" 200 6 "-"
127.0.0.1 - - [05/Apr/2017:13:36:55 -0400] "GET /UserServer/zsd_print_extensions.php HTTP/1.1" 200 3541 "-"
127.0.0.1 - - [05/Apr/2017:13:36:55 -0400] "GET /UserServer/zsd_is_webserver_alive.php HTTP/1.1" 200 6 "-"
127.0.0.1 - - [05/Apr/2017:13:43:49 -0400] "POST /ZendServer/Api/sendNotification HTTP/1.1" 200 194 "-" "Zend_Http_Client/1.10"

chrishiebert
Posts: 4
Joined: Fri Dec 28, 2012 6:25 pm

Re: Apache Access Logs - Limit entries

Post by chrishiebert » Mon Apr 10, 2017 9:20 pm

You can remove them with a quick fix in your Apache conf file.

Code: Select all

SetEnvIf Request_URI "^/UserServer/zsd_print_extensions.php$" log_exclude=true
SetEnvIf Request_URI "^/UserServer/zsd_is_webserver_alive.php$" log_exclude=true
# Change log to test for not log_exclude
CustomLog logs/access_log combined env=!log_exclude


Here is my complete setup.
I exclude the UserServer and ZendServer entries from the main access log.
Then have all ZendServer entries logged to access_zs_log:

Code: Select all

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{Cookie}n \"%r\" %t" cookie
LogFormat "%{User-agent}i" agent
LogFormat "%{Referer}i -> %U" referer
LogFormat "%h %l %u %t \"%r\" %>s %b" common

# Check for requests to exclude from the access log
SetEnvIf Request_URI "^/UserServer/zsd_print_extensions.php$" log_exclude=true
SetEnvIf Request_URI "^/UserServer/zsd_is_webserver_alive.php$" log_exclude=true
SetEnvIf Request_URI "^/ZendServer/(.*)$"  log_exclude=true

SetEnvIf Request_URI "^/ZendServer/(.*)$"  log_zf_include=true
SetEnvIf Request_URI "^/ZendServer/Api/getNotifications" log_zf_include=false
SetEnvIf Request_URI "^/ZendServer/Api/zrayGetRequestsInfo" log_zf_include=false

# Change log to test for not log_exclude
CustomLog logs/access_log combined env=!log_exclude
CustomLog logs/access_zs_log combined env=log_zf_include

dani1879
Posts: 6
Joined: Thu Feb 05, 2015 8:14 pm

Re: Apache Access Logs - Limit entries

Post by dani1879 » Mon Apr 10, 2017 9:26 pm

I actually found this example online and stopped them from logging, however, is there a way to turn off these types of log messages from being generated by Zend? That is if Zend is actually sending out these requests. We are trying to limit unnecessary requests.

Post Reply