Reputation: 63
Newbie question: how do I stop my apache error log files from being filled up with SOAP XML requests & responses? From what I can tell, these aren't errors and everything's working fine...the only indication is "[error]" after the timestamp. They include image data so they can be pretty large.
Upvotes: 0
Views: 536
Reputation: 4255
Check this answer, especially the link to the mod_log_config documentation.
Basically, you should be able to customize the types of information that get written to your logs. Be aware though that if you use any log analysis software or scripts that expect a particular format, you may need to reconfigure those tools to understand your new custom format.
Update: This is probably the most relevant except from the mod_log_config documentation. The directives go in your apache configuration file, where you're specifying the location and format of your error log. In your case, you'll want the conditional to check the headers or something in the environment to determin whether it's a SOAP request that you want to ignore.
The third argument is optional and controls whether or not to log a particular request based on the presence or absence of a particular variable in the server environment. If the specified environment variable is set for the request (or is not set, in the case of a 'env=!name' clause), then the request will be logged.
Environment variables can be set on a per-request basis using the mod_setenvif and/or mod_rewrite modules. For example, if you want to record requests for all GIF images on your server in a separate logfile but not in your main log, you can use:
SetEnvIf Request_URI .gif$ gif-image CustomLog gif-requests.log common env=gif-image CustomLog nongif-requests.log common env=!gif-image
Or, to reproduce the behavior of the old RefererIgnore directive, you might use the following:
SetEnvIf Referer example.com localreferer CustomLog referer.log referer env=!localreferer
Upvotes: 1