Skip to content

Instantly share code, notes, and snippets.

@krisrice
Last active December 6, 2022 19:53
Show Gist options
  • Save krisrice/590ab6eabfc551120b5a4f2fe9eb80b9 to your computer and use it in GitHub Desktop.
Save krisrice/590ab6eabfc551120b5a4f2fe9eb80b9 to your computer and use it in GitHub Desktop.
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
<!--
Drop this file into
../global/standalone/etc/jetty-accesslog.xml
-->
<!-- =============================================================== -->
<!-- Configure the Jetty Request Log -->
<!-- =============================================================== -->
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<!-- =========================================================== -->
<!-- Configure Request Log for Server -->
<!-- (Use RequestLogHandler for a context specific RequestLog -->
<!-- =========================================================== -->
<Set name="RequestLog">
<New id="RequestLog" class="org.eclipse.jetty.server.CustomRequestLog">
<!-- Writer -->
<Arg>
<New class="org.eclipse.jetty.server.AsyncRequestLogWriter">
<Arg>
<Call name="resolvePath" class="org.eclipse.jetty.xml.XmlConfiguration">
<Arg><Property name="jetty.base"/></Arg>
<Arg>
<Property name="jetty.requestlog.filePath">
<Default>
<!--
PATH and FILE NAME
-->
<Property name="jetty.requestlog.dir" default="/tmp/logs"/>/MY_ORDS_LOGS.yyyy_mm_dd.request.log
</Default>
</Property>
</Arg>
</Call>
</Arg>
<Set name="filenameDateFormat"><Property name="jetty.requestlog.filenameDateFormat" default="yyyy_MM_dd"/></Set>
<Set name="retainDays"><Property name="jetty.requestlog.retainDays" default="90"/></Set>
<Set name="append"><Property name="jetty.requestlog.append" default="false"/></Set>
<Set name="timeZone"><Property name="jetty.requestlog.timezone" default="GMT"/></Set>
</New>
</Arg>
<!-- Format String -->
<Arg>
<Property name="jetty.customrequestlog.formatString">
<!--
FORMAT STRING
Sample format below is :
client user time "request" status bytes "referer" "ua" hostheader
-->
<Default><Property name="standalone.custom.access.format" default="%{client}a %u %t \'%r\' %s %{CLF}O \'%{Referer}i\' \'%{User-Agent}i\' %{ms}T %{Host}i %{ADB-Request-Id}i"/></Default>
</Property>
</Arg>
</New>
</Set>
</Configure>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment