Apache Access Logs - Limit entries

General discussion on Zend Server for IBM System i

Apache Access Logs - Limit entries

Postby dani1879 on 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"
dani1879
 
Posts: 6
Joined: Thu Feb 05, 2015 8:14 pm

Re: Apache Access Logs - Limit entries

Postby chrishiebert on 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
chrishiebert
 
Posts: 2
Joined: Fri Dec 28, 2012 6:25 pm

Re: Apache Access Logs - Limit entries

Postby dani1879 on 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.
dani1879
 
Posts: 6
Joined: Thu Feb 05, 2015 8:14 pm


Return to Zend Server for IBM i

Who is online

Users browsing this forum: No registered users and 4 guests

cron