views:

14

answers:

1

Hi

We deliver a huge amount of data based on soap requests. Whenever a request fails, soap specifies a 500 error must be returned with a response object telling about the error. Now I know for a fact that MANY of our responses actually should be 400 errors due to bad requests, but we are not allowed to send those. Is it possible to add something to the http log files for the 500 "I am not really a 500" errors to be picked up by Analog or other stats?

Thanks

+2  A: 

If you are using Apache you could use a custom log format and add a field such as:

%{Foobar}o

Where "Foobar" is the name of a header you send back in the response. Then all you need to do is add a custom header in the error response to indicate it was due to bad user input. Just be sure to start your custom header name with "X-" so that it is valid (i.e. X-Foobar)

See the mod_log_config documentation for more information about custom log formats.

Marc Novakowski
Thanks, I will have a look on Monday to see if that is feasible
mplungjan
I have not yet implemented it, but it seems like it would work. I will come back with a comment when it has been tested Thanks
mplungjan