Skip to main content
Version: v2023.20.0

Logs

Since version 3, ARender relied on two different logging libraries: [Log4j] (http://logging.apache.org/) 1.x (Web-UI) and [Logback] (https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-logging) (Rendition).

Note that Log4J no longer provides support for its version 1.x since August 2015 which can be problematic for security vulnerabilities that will never be corrected.

To harmonize the use of Web-UI and Rendition logs, we have opted to switch to Logback on the Web-UI side rather than staying and upgrading the Log4j version to 2.x.

Obviously, this will have an impact on the configuration since the Log4J configuration is different from Logback.

To migrate the log4j.properties files to its logback equivalent, you can use the log4j.properties translator (here.

Convert Log4J configuration file to Logback

The log4j configuration file for the Web-UI part looked like this :

log4j.rootCategory=WARN, default
log4j.category.com.arondor = INFO
log4j.category.com.arondor.common.management = FATAL
log4j.category.arender-startup=INFO

log4j.category.com.arondor.viewer.common.logger = INFO, perf

log4j.category.com.arondor.common.reflection.parser.spring=OFF

# Avoid to have the performance log in the default log
log4j.additivity.com.arondor.viewer.common.logger=false

log4j.appender.default=org.apache.log4j.ConsoleAppender
log4j.appender.default.layout=org.apache.log4j.PatternLayout
log4j.appender.default.layout.ConversionPattern=%d{ISO8601} %p [%t] %c:%L - %m%n

log4j.appender.VIEWER=org.apache.log4j.RollingFileAppender
log4j.appender.VIEWER.MaxFileSize=20000KB
log4j.appender.VIEWER.MaxBackupIndex=6
log4j.appender.VIEWER.File=/tmp/viewer/server.log
log4j.appender.VIEWER.layout=org.apache.log4j.PatternLayout
log4j.appender.VIEWER.layout.ConversionPattern=%d{ISO8601} %p [%t] %c:%L - %m%n

log4j.appender.perf=org.apache.log4j.RollingFileAppender
log4j.appender.perf.MaxFileSize=20000KB
log4j.appender.perf.MaxBackupIndex=6
log4j.appender.perf.File=arender-hmi-perf.log
log4j.appender.perf.layout=org.apache.log4j.PatternLayout
log4j.appender.perf.layout.ConversionPattern=%m%n

Now, after going through the log4j.properties translator, we get the following result:

logback.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>

<!-- File Appender for Web-UI server log -->
<appender name="SERVER" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>arender-server.log</file>
<encoder>
<pattern>%d{ISO8601} %p [%t] %c:%L - %m%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>arender-server.%i.log.zip</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>20</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>50MB</maxFileSize>
</triggeringPolicy>
</appender>

<!-- File Appender for Web-UI perf log -->
<appender name="PERF" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>arender-perf.log</file>
<encoder>
<pattern>%msg%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>arender-perf.%i.log.zip</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>6</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>50MB</maxFileSize>
</triggeringPolicy>
</appender>

<!-- Console Appender -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{ISO8601} %p [%t] %c:%L - %m%n</pattern>
</encoder>
</appender>

<!-- Logger -->
<logger name="arender-startup" level="INFO" />
<logger name="com.arondor.common.reflection.parser.spring" level="OFF"/>
<logger name="com.arondor.viewer.common.logger" level="INFO" additivity="false">
<appender-ref ref="PERF" />
</logger>
<logger name="com.arondor" level="INFO">
<appender-ref ref="SERVER" />
</logger>
<logger name="com.arondor.common.management" level="FATAL" />

<root level="WARN">
<appender-ref ref="STDOUT" />
</root>
</configuration>

Custom logback configuration (Web-UI — Spring Boot only)

info

This feature is only available when the Web-UI is deployed as a Spring Boot jar. It is not supported when deployed as a WAR on Tomcat.

Instead of replacing the entire logback configuration, the Spring Boot Web-UI exposes two properties to customize logging without maintaining a full logback file.

Log output directory

By default, log files are written to the current working directory. To write them to a specific directory, add the following property in the arender-custom-server.properties file located in the configurations folder:

arender.logging.path=/var/log/arender

Custom logback fragment

To include a custom logback fragment, set the name of the fragment file:

arender.logging.fragment.name=custom-logback-fragment.xml

The fragment is resolved from the classpath. It must therefore be placed in one of the following locations:

  • Directly as a file in the configurations/ directory of the deployment folder (this directory is on the classpath of the Spring Boot jar)
  • Bundled inside a JAR placed in the lib/ directory of the deployment folder

The fragment file is included via the Logback <include> mechanism. It can contain any valid logback configuration elements such as <appender>, <logger>, or <root> overrides.

Example fragment — adding a file appender for a specific package:

custom-logback-fragment.xml
<included>
<appender name="CUSTOM_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>/var/log/arender/custom.log</file>
<encoder>
<pattern>%d{ISO8601} %p [%t] %c:%L - %m%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>/var/log/arender/custom.%i.log.zip</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>10</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>50MB</maxFileSize>
</triggeringPolicy>
</appender>

<logger name="com.arondor.viewer" level="DEBUG">
<appender-ref ref="CUSTOM_FILE" />
</logger>
</included>
info

The fragment file must use the <included> root element instead of <configuration>. This is required by the Logback file include mechanism.

warning

Do not set arender.logging.fragment.name to an empty value. If the property is absent, the default value custom-logback-fragment.xml is used and silently skipped if not found on the classpath. Setting it explicitly to an empty string may cause unexpected Logback behaviour.

Docker configuration

When deploying with Docker, both properties can be set as environment variables using Spring Boot's relaxed binding convention (dots replaced by underscores, uppercased):

PropertyEnvironment variable
arender.logging.pathARENDER_LOGGING_PATH
arender.logging.fragment.nameARENDER_LOGGING_FRAGMENT_NAME
docker-compose.yml
services:
arender-ui:
environment:
- ARENDER_LOGGING_PATH=/var/log/arender
- ARENDER_LOGGING_FRAGMENT_NAME=custom-logback-fragment.xml

Location of log files

The location of the output log file for the presentation server (Web-UI) is in <TOMCAT_PATH>/bin

For rendition log files, you can find them in the following locations:

Micro-ServicePathDetail
RenditionEngineRendition/modules/RenditionEngine/arender-server.logLogs dedicated to call routing
TaskConversionEngineRendition/modules/TaskConversionEngine/arender-taskconversion.logLogs dedicated to documents conversion
JNIPDFEngineRendition/modules/JNIPDFEngine/arender-jnipdf.logLogs dedicated to image generation
PDFBoxEngineRendition/modules/PDFBoxEngine/arender-pdfbox.logLogs dedicated to PDF manipulations

Location of log configuration file

Web-UI

ServicePathDetail
Web-UI Serverarondor-arender-hmi-spring-boot-2026.0.0.jar\BOOT-INF\classes\logback-spring.xmlLogs dedicated to the presentation server

Rendition

For each of the micro services, you will find the default logback configuration file in their jar.

ServicePathDetail
RenditionEngineBOOT-INF/classes/logback-spring.xmlLogs configuration
TaskConversionEngineBOOT-INF/classes/logback-spring.xmlLogs configuration
JNIPDFEngineBOOT-INF/classes/logback-spring.xmlLogs configuration
PDFBoxEngineBOOT-INF/classes/logback-spring.xmlLogs configuration

In order to outsource the logback configuration, simply create your logback.xml file and then create an application.properties file located next to the jar of each of the microservices with the following property to indicate the location of the customized logback configuration file.

logging.config=file:<YOUR_PATH>/logback-spring.xml

Format logs in JSON

Most Java logging libraries today offer different layout options for formatting logs to precisely match the needs of each project.

Here we will see how to format and produce our log entries in JSON format.

Here is an example of the default Broker microservice configuration so that logs are saved to a file:

logback-spring.xml
<appender name="SERVER" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>arender-server.log</file>
<encoder>
<pattern>%date %level [%thread] %logger{10} [%file:%line] %msg%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>arender-server.%i.log.zip</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>100</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>50MB</maxFileSize>
</triggeringPolicy>
</appender>

To configure the formatting in JSON, you must redefine the encoder tag to use the LayoutWrappingEncoder. This will allow us to use the layout tag to set the JSON formatting as described below:

logback-spring.xml
<appender name="SERVER" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>arender-server.log</file>
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="ch.qos.logback.contrib.json.classic.JsonLayout">
<jsonFormatter class="ch.qos.logback.contrib.jackson.JacksonJsonFormatter">
<prettyPrint>true</prettyPrint>
</jsonFormatter>
<timestampFormat>yyyy-MM-dd' 'HH:mm:ss.SSS</timestampFormat>
</layout>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>arender-server.%i.log.zip</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>100</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>50MB</maxFileSize>
</triggeringPolicy>
</appender>

Automatically reloading configuration file upon modification

If instructed to do so, logback-classic will scan for changes in its configuration file and automatically reconfigure itself when the configuration file changes. In order to instruct logback-classic to scan for changes in its configuration file and to automatically re-configure itself set the scan attribute of the <configuration> element to true, as shown next.

logback-spring.xml
<configuration scan="true">
...
</configuration>