How To
ForgeRock Identity Platform
Does not apply to Identity Cloud

How do I rotate AM 5.x and 6.x debug logs?

Last updated Apr 13, 2021

The purpose of this article is to provide information on rotating AM debug logs. Debug logs are located in the /path/to/openAM/debug directory by default.


2 readers recommend this article

Rotating debug logs

AM 7 and later uses Logback for configuration of debug logging. See Maintenance Guide › To Rotate Debug Logs with Logback.xml for further information.

Pre-AM 7

AM does not rotate debug logs by default, but you can configure it to do so using either time interval or size:

  • Time interval (in minutes) - for example, every 1440 minutes for once a day. The time interval specified starts when the first log message is logged to the log file.
  • Size (in MB) - for example, when the debug log reaches 2MB.

​You can rotate debug log files by updating the debugconfig.properties file, which is located in the /path/to/tomcat/webapps/openam/WEB-INF/classes directory where AM is deployed. 

Note

It is recommended that you copy the debug logs prior to clearing the contents, rather than deleting the logs as this can cause issues if a process is still holding a filehandle. See How do I clear debug logs in AM (All versions)? for further information. Additionally, you should keep debug logging to a minimum (level: error) and only increase it when troubleshooting an issue.

Time Interval

  1. Edit the debugconfig.properties file and set the org.forgerock.openam.debug.rotation property and optionally the org.forgerock.openam.debug.prefix and/or org.forgerock.openam.debug.suffix properties. For example, if you want your debug logs to rotate every 1440 minutes with a suffix of the date and time (timestamp), you would set the rotation and suffix properties in this file as follows:  org.forgerock.openam.debug.rotation=1440 org.forgerock.openam.debug.suffix=-MM.dd.yyyy-HH.mm
  2. Restart the web application container in which AM runs to apply these configuration changes.

You would then see debug logs rotated every 1440 minutes with the timestamp indicating when they were rotated. For example:... CoreSystem-07.22.2016-16.23 CoreSystem-07.21.2016-16.23 CoreSystem-07.20.2016-16.23 CoreSystem-07.19.2016-16.23 ...

Size

  1. Edit the debugconfig.properties file and set the org.forgerock.openam.debug.rotation.maxsize property and optionally the org.forgerock.openam.debug.prefix and/or org.forgerock.openam.debug.suffix properties. For example, if you want your debug logs to rotate each time they reach 2MB with a suffix of the date and time (timestamp), you would set the maxsize and suffix properties in this file as follows:  org.forgerock.openam.debug.rotation.maxsize=2 org.forgerock.openam.debug.suffix=-MM.dd.yyyy-HH.mm_ss.SSS
  2. Restart the web application container in which AM runs to apply these configuration changes.

See Also

How do I enable Message level debugging in AM (All versions) debug files?

How do I clear debug logs in AM (All versions)?

How do I rotate AM (All versions) Fedlet debug logs?

Setup and Maintenance Guide › Rotating Debug Logs

Related Training

N/A

Related Issue Tracker IDs

OPENAM-12445 (Have debug.out and files Rotate where active log does not have suffix)

OPENAM-12274 (Allow both size and time rotation instead of only allowing one or the other)

OPENAM-9098 (Changes in debugconfig.properties don't take effect immediately)

OPENAM-7485 (OpenAM debug log retention.)

OPENAM-7376 (Debug log rotation: remove old debug files)


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