Jetty 9.2 Request Access log Configuration

Source: Internet
Author: User
Tags deprecated

Jetty 9.2 Under Org.eclipse.jetty.NCSARequestLog, has been deleted, cannot find the item class, Web Access needs to be handled through ORG.ECLIPSE.JETTY.SERVER.ASYNCNCSAREQUESTLOG.

Modification Method:

To open the Jetty.home/etc/jetty.xml file, add the following content.

1) Add request processing Landlerrequestloghandler

<Item>

<new id= "Requestlog" class= "Org.eclipse.jetty.server.handler.RequestLogHandler"/>

</Item>

2) Add Create request processing instance configuration

<ref id= "Requestlog" >

<set name= "Requestlog" >

<new id= "Requestlog" class= "Org.eclipse.jetty.server.AsyncNCSARequestLog" >

<setname= "filename" ><property name= "Jetty.base" default= "/><property>".

<Name>jetty.requestlog.filePath</Name>

<Deprecated>requestlog.filename</Deprecated>

<default><propertyname= "Jetty.requestlog.dir" default= "/logs"/>/yyyy_mm_dd.request.log</default >

</Property>

</Set>

<setname= "Filenamedateformat" ><propertyname= "Jetty.requestlog.filenameDateFormat" deprecated= " Requestlog.filenamedateformat "default=" Yyyy_mm_dd "/></set>

<setname= "Retaindays" ><propertyname= "Jetty.requestlog.retainDays" deprecated= "Requestlog.retain" default= "/></set>"

<setname= "Append" ><propertyname= "Jetty.requestlog.append" deprecated= "Requestlog.append" default= "false "/></set>

<setname= "Extended" ><propertyname= "jetty.requestlog.extended" deprecated= "requestlog.extended" default= "False"/></set>

<setname= "Logcookies" ><propertyname= "jetty.requestlog.cookies" deprecated= "Requestlog.cookies" default= "False"/></set>

<setname= "Logtimezone" ><propertyname= "Jetty.requestlog.timezone" deprecated= "Requestlog.timezone" default= "GMT"/></set>

</New>

</Set>

</Ref>

code example:

<?xml version= "1.0"?>

<! DOCTYPE Configure Public "-//jetty//configure//en" "Http://www.eclipse.org/jetty/configure_9_0.dtd" >

<!--===============================================================--

<!--documentation of this file Formatcan is found at:-

<!--Http://wiki.eclipse.org/Jetty/Reference/jetty.xml_syntax--

<!---->

<!--Additional configuration files areavailable in $JETTY _home/etc-

<!--and can be mixed in. See Start.inifile for the default---

<!--configuration files. -

<!---->

<!--for a description of the configurationmechanism, see---

<!--output of:-

<!--Java-jar Start.jar-? -

<!--===============================================================--

<!--===============================================================--

<!--Configure a Jetty server instancewith an ID "server"--

<!--other configuration files may alsoconfigure the "Server"--

<!--ID, in which case they is addingconfiguration to the same-

<!--instance. If other configuration has a different id,they--

<!--'ll create and configure anotherinstance of Jetty. -

<!--Consult the Javadoc ofo.e.j.server.server for all--

<!--configuration that could be sethere. -

<!--===============================================================--

<configure id= "Server" class= "Org.eclipse.jetty.server.Server" >

<set name= "Handler" >

<new id= "Handlers" class= "Org.eclipse.jetty.server.handler.HandlerCollection" >

<set name= "Handlers" >

<array type= "Org.eclipse.jetty.server.Handler" >

<Item>

<new id= "Contexts" class= "org.eclipse.jetty.server.handler.ContextHandlerCollection"/>

</Item>

<Item>

<new id= "DefaultHandler" class= "Org.eclipse.jetty.server.handler.DefaultHandler"/>

</Item>

<Item>

<new id= "Requestlog" class= "Org.eclipse.jetty.server.handler.RequestLogHandler"/>

</Item>

</Array>

</Set>

</New>

</Set>

<ref id= "Requestlog" >

<set name= "Requestlog" >

<new id= "Requestlog" class= "Org.eclipse.jetty.server.AsyncNCSARequestLog" >

<setname= "filename" ><property name= "Jetty.base" default= "/><property>".

<Name>jetty.requestlog.filePath</Name>

<Deprecated>requestlog.filename</Deprecated>

<default><propertyname= "Jetty.requestlog.dir" default= "/logs"/>/yyyy_mm_dd.request.log</default >

</Property>

</Set>

<setname= "Filenamedateformat" ><propertyname= "Jetty.requestlog.filenameDateFormat" deprecated= " Requestlog.filenamedateformat "default=" Yyyy_mm_dd "/></set>

<setname= "Retaindays" ><propertyname= "Jetty.requestlog.retainDays" deprecated= "Requestlog.retain" default= "/></set>"

<setname= "Append" ><propertyname= "Jetty.requestlog.append" deprecated= "Requestlog.append" default= "false "/></set>

<setname= "Extended" ><propertyname= "jetty.requestlog.extended" deprecated= "requestlog.extended" default= "False"/></set>

<setname= "Logcookies" ><propertyname= "jetty.requestlog.cookies" deprecated= "Requestlog.cookies" default= "False"/></set>

<setname= "Logtimezone" ><propertyname= "Jetty.requestlog.timezone" deprecated= "Requestlog.timezone" default= "GMT"/></set>

</New>

</Set>

</Ref>

</Configure>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.