Manage logs
Customize RPA logrotate
The section describes how to tweak the log rotation on RPA Server. This feature is needed to free disk space and improve security.
- Go to ${rpa_installation_folder}\rpa-grid (by default it is C:\RPA\rpa-grid).
- Change the following values in logback-hub.xml and in all needed logback-nodeX.xml files:
To change the max size of RPA log, add the
<maxFileSize>tag inside the<timeBasedFileNamingAndTriggeringPolicy>tag, and set value of this tag (1024KB, 100MB, 1GB etc.):<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> <maxFileSize>100MB</maxFileSize> </timeBasedFileNamingAndTriggeringPolicy>To change max days of history of logs, add the
<maxHistory>tag inside the<rollingPolicy>tag, and set value of this tag as a number (10, 30, 60, etc.):<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <maxHistory>30</maxHistory> </rollingPolicy>
Expand to see the combined example
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_DIR}/${LOG_FILE_NAME}-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 100MB -->
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!-- keep 30 days' worth of history -->
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<charset>UTF-8</charset>
<pattern>%date{ISO8601} %-5level [%thread] %class.%M[:%L] - %msg%n</pattern>
</encoder>
</appender>
Customize RPA logs location
RPA Nginx
Open nginx.conf located in <RPA_ROOT>/nginx/conf directory and add the following lines before server section:
access_log d:/RPA/nginx/access.log; error_log d:/RPA/nginx/error.log; server { ...Make sure that target directory exists before restarting nginx.
tip
If rotation scripts are used, update rotate_nginx_logs.bat script.
RPA grid
Open logback-*.xml located in the <RPA_ROOT>/rpa-grid directory and edit the LOG_DIR property:
<property name="LOG_DIR" value="d:/RPA/logs-grid"/>
Required files:
- logback-hub.xml
- logback-node0.xml
- logback-node1.xml
Optional files depending on the number of configured RPA nodes:
- logback-nodeX.xml