How To
ForgeRock Identity Platform
Does not apply to Identity Cloud

How do I configure Jetty Request logging for IDM (All versions)?

Last updated Jan 12, 2023

The purpose of this article is to provide assistance with configuring Jetty® Request logging for IDM. Request logs provide details of every request that the server processes and can be a useful troubleshooting tool.


Overview

Jetty Request logging uses one of the following classes depending on the Jetty version:

In IDM 6.5 and later, you should use the CustomRequestLog class; in IDM 6, you should use the NCSARequestLog class.

Configuring Jetty Request logging

You can configure Jetty Request logging by adding something similar to the following at the end of the jetty.xml file (located in the /path/to/idm/conf directory):

  • IDM 6.5 and later: <Set name="requestLog"> <New id="RequestLog" class="org.eclipse.jetty.server.CustomRequestLog"> <!-- Writer --> <Arg> <New class="org.eclipse.jetty.server.AsyncRequestLogWriter"> <!-- Note, yy_mm__dd is a place holder for the date and does not specify the date format itself --> <Arg><SystemProperty name="jetty.logs" default="./logs"/>/yyyy_mm_dd.request.log</Arg> <Set name="filenameDateFormat">yyyy_MM_dd</Set> <Set name="retainDays">90</Set> <Set name="append">true</Set> <Set name="timeZone">GMT</Set> </New> </Arg> <!-- Format String --> <Arg> <Get class="org.eclipse.jetty.server.CustomRequestLog" name="EXTENDED_NCSA_FORMAT"/> </Arg> </New> </Set>
  • IDM 6: <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><SystemProperty name="jetty.logs" default="./logs"/>/yyyy_mm_dd.request.log</Arg> <Set name="retainDays">90</Set> <Set name="append">true</Set> <Set name="extended">false</Set> <Set name="LogTimeZone">GMT</Set> </New> </Set> </Ref>

The example configurations will output the Request log to $IDM_HOME/logs and the log filenames will include the date (in yyyy_mm_dd format). Request log files will be kept for 90 days before being deleted. Existing log files will be appended to and the extended NCSA format will be used in the GMT timezone.

You should change these example configurations per your logging requirements. See Class CustomRequestLog or Class NCSARequestLog for further configuration options.

See Also

Configuring Jetty Request Logs

Class CustomRequestLog

Class NCSARequestLog

Related Training

N/A

Related Issue Tracker IDs

N/A


Copyright and Trademarks Copyright © 2023 ForgeRock, all rights reserved.