空的请求日志 [英] Empty request logs

查看:101
本文介绍了空的请求日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将其添加到jetty.xml:

<Get name="handler">
    <Call name="addHandler">
        <Arg>
            <New id="RequestLog" class="org.eclipse.jetty.server.handler.RequestLogHandler" />
        </Arg>
    </Call>
</Get>
<Ref id="RequestLog">
    <Set name="requestLog">
        <New id="RequestLogImpl" class="org.eclipse.jetty.server.NCSARequestLog">
            <Arg>
                /home/aromanov/workspaces/odp-server/ru.focusmedia.odp.server.karaf.launcher/data/jettylog/yyyy_mm_dd.request.log
            </Arg>
            <Set name="retainDays">90</Set>
            <Set name="append">true</Set>
            <Set name="extended">true</Set>
            <Set name="logServer">true</Set>
            <Set name="logDispatch">true</Set>
            <Set name="LogTimeZone">GMT</Set>
        </New>
    </Set>
</Ref>

已创建日志文件,但是在浏览器中访问该页面(并获取"404,由Jetty驱动")后,日志中没有任何内容.为什么会这样?

The log file is created, but after accessing the page in the browser (and getting "404, powered by Jetty"), nothing appears in the log. Why could this be?

推荐答案

我怀疑您的处理程序链配置不正确.考虑一下由一系列处理程序处理的请求,该记录处理程序是一个在处理请求时仅引用日志文件的处理程序.因此,如果您没有在日志中获取内容,则您的处理程序不在正在执行的链中.您可能只需要将其添加到处理程序列表中,然后 可以处理它的其他内容即可.

I suspect your handler chain is not configured correctly. Think of the request getting processed by a chain of handlers, and this logging handler is one that just makes a reference to the log file as the request processes through. So if your not getting content in the log then your handler is not in the chain of execution that is occurring. You likely just need to add it to the handler list, before something else that might handle it.

这篇关于空的请求日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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