chrome网络调试器为我提供了为页面加载的所有HTTP资源的绝佳视图.但是只要加载新的顶级HTML页面,它就会清除列表.这使得调试由于某种原因而自动重新加载的页面非常困难(运行脚本或300个响应).
在加载新的顶级页面时,是否可以告诉chrome不要清除网络调试器?或者我可以回去查看上一页的网络资源吗?
或者我可以以某种方式强制chrome在加载新页面之前暂停,当我不控制页面时我正在尝试调试正在进行重定向?这是一个错误的开放式舞蹈的一部分,因此SSL和凭证的组合使得使用命令行工具进行调试变得极其困难.
或者萤火虫可以做我想要的吗?
我有一个RESTEasy Web服务器,有很多方法.我希望实现logback来跟踪所有请求和响应,但我不想添加log.info()到每个方法.
也许有办法在一个地方捕获请求和响应并记录它.也许类似于RESTEasy上的HTTP请求流程链上的过滤器.
@Path("/rest")
@Produces("application/json")
public class CounterRestService {
//Don't want use log in controler every method to track requests and responces
static final Logger log = LoggerFactory.getLogger(CounterRestService.class);
@POST
@Path("/create")
public CounterResponce create(@QueryParam("name") String name) {
log.info("create "+name)
try {
CounterService.getInstance().put(name);
log.info("responce data"); // <- :((
return new CounterResponce();
} catch (Exception e){
log.info("responce error data"); // <- :((
return new CounterResponce("error", e.getMessage());
}
}
@POST
@Path("/insert")
public CounterResponce create(Counter counter) {
try {
CounterService.getInstance().put(counter);
return new CounterResponce(); …Run Code Online (Sandbox Code Playgroud) 要在开发期间调试HTTP请求,我希望我的WildFly 8应用程序服务器将HTTP请求(包括请求方法和标头)转储到日志文件中.server.log没关系.
在WildFly的HTTP子系统的源代码中,我找到了RequestDumpingHandler和相应的日志记录类别io.undertow.request.dump
然而,我无法弄清楚,如何使其适用于通过我的应用程序(有一些静态资源和JAX-RS处理程序WAR)服务的所有请求安装头.
相应的文档页面(Undertow Web子系统配置)并不能真正解释处理程序.<handler>配置部分中有一个元素
<?xml version="1.0" ?>
<server xmlns="urn:jboss:domain:2.1">
...
<profile>
...
<subsystem xmlns="urn:jboss:domain:undertow:1.1">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="default" socket-binding="http"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<filter-ref name="server-header"/>
<filter-ref name="x-powered-by-header"/>
</host>
</server>
<servlet-container name="default">
<jsp-config/>
</servlet-container>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
<!-- <dump-request /> ?? or something?-->
</handlers>
<filters>
<response-header name="server-header" header-name="Server" header-value="WildFly/8"/>
<response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
</filters>
</subsystem>
...
</profile>
...
</server>
Run Code Online (Sandbox Code Playgroud)
但据我所知,只有<file>和代理人在那里(?).
如何在WildFly中记录传入HTTP请求的完整详细信息? …