How To
ForgeRock Identity Platform
ForgeRock Identity Cloud

How do I enable debug logging and log rotation for the Remote Connector Server (RCS)?

Last updated May 20, 2021

The purpose of this article is to provide information on enabling debug logging and log rotation for the Java® RCS.


Overview

By default, logging is not enabled for the Java RCS. Additionally, log files are not set to rotate by default, which means they will grow in size indefinitely when logging is enabled.

If you want to enable logging for the RCS, it is strongly recommended that you also configure the log files to rotate as described in this article.

Debug Logging

You can enable debug logging as follows:

  1. Edit the logback.xml file (which is located in the /path/to/openicf/lib/framework/ directory) and uncomment the following section: <logger name="org.identityconnectors.framework.impl.api.LoggingProxy" level="DEBUG" additivity="false">         <appender-ref ref="TRACE-FILE"/>     </logger>
  2. Restart the RCS:$ /path/to/openicf/bin/ConnectorServer.sh /runThe debug logs will be written to the ConnectorServer.log (located in the /path/to/openicf/logs directory).

Rotating Log Files

You can configure the RCS to rotate log files as follows:

  1. Edit the logback.xml file and replace the following section (appender class: ch.qos.logback.core.FileAppender for the ConnectorServer.log file): <appender name="SERVER-FILE" class="ch.qos.logback.core.FileAppender">         <file>logs/ConnectorServer.log</file>         <append>true</append>         <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">             <fileNamePattern>logs/ConnectorServer-%d{yyyyMMdd}.log</fileNamePattern>         </rollingPolicy>         <encoder>             <pattern>%date{"MMM dd, yyyy h:mm:ss a"} %-5level %logger{35}: %msg %n</pattern>         </encoder>     </appender>With this section:<appender name="SERVER-FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">        <file>logs/ConnectorServer.log</file>         <append>true</append>         <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">             <fileNamePattern>logs/ConnectorServer-%d{yyyyMMdd}.log</fileNamePattern>             <!-- keep 30 days of logs capped at 1GB total size -->             <maxHistory>30</maxHistory>             <totalSizeCap>1GB</totalSizeCap>         </rollingPolicy>         <encoder>             <pattern>%date{"MMM dd, yyyy h:mm:ss a"} %-5level %logger{35}: %msg %n</pattern>         </encoder>     </appender>Where:
    • The appender class is changed to ch.qos.logback.core.rolling.RollingFileAppender to rotate the logs.
    • The maxHistory and totalSizeCap properties are added to ensure old logs are removed. This example configures them so that 30 days of logs are kept, capped at 1GB in size, but you can set them as needed for your environment.
  2. Restart the RCS:$ /path/to/openicf/bin/ConnectorServer.sh /run

See Also

RCS in Identity Cloud

Related Issue Tracker IDs

OPENICF-1638 (RCS logback.xml should be configured for rolling log files with max age/size over a single ever growing file by default)



Copyright and TrademarksCopyright © 2021 ForgeRock, all rights reserved.
Loading...