再利用,并加入到500错误摆脱肥皂更好的统计数据 [英] Reuse and add to 500 error to get better stats from soap

查看:99
本文介绍了再利用,并加入到500错误摆脱肥皂更好的统计数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们提供了巨大的基于SOAP请求数据量。
每当一个请求失败,肥皂指定了一个500错误必须与响应对象讲述的错误被退回。
现在我知道一个事实,即我们的许多反应的实际上应该是由于不良的请求400错误,但我们不会允许发送的。
是否有可能添加的东西到HTTP日志文件500我不是一个真正的500强要由模拟或其他统计拿起错误?

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?

感谢

推荐答案

如果您使用的是Apache,你可以使用自定义日志格式,并添加一个字段,如:

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

%{Foobar的} 0

%{Foobar}o

在哪里Foobar的是你发回的响应头的名称。然后,所有你需要做的就是在错误的反应,以表明它是由于恶劣的用户输入添加自定义标题。只是一定要以X-开始您的自定义标题名称,以便它是有效的(即,x-Foobar的)

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)

查看 mod_log_config 文档有关自定义日志的详细信息格式。

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

这篇关于再利用,并加入到500错误摆脱肥皂更好的统计数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆