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 isC:\RPA\rpa-grid).Change the following values in
logback-hub.xmland in all neededlogback-nodeX.xmlfiles: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, and so on):<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, and so on):<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.conflocated in<RPA_ROOT>/nginx/confdirectory 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
targetdirectory exists before restarting nginx.
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.xmllogback-node0.xmllogback-node1.xml
Optional files depending on the number of configured RPA nodes:
logback-nodeX.xml