Skip to main content

Custom log file location

To store the platform's log files in a specific location, edit two configuration files in your pre-deployed Tomcat.

Prerequisites

  • File-system access to the Tomcat conf directory, and the ability to restart the application server.

Steps

Tomcat logs

Change the Tomcat log location in apache-tomcat-9.0.xx\conf\logging.properties. The file references an igrafx.basedirectory variable that points to the igrafxdata directory by default — replace that reference with your custom log folder, then restart the application server.

Application logs

Set the application log location in apache-tomcat-9.0.xx\conf\log4j2.xml. Add a new file appender to <Appenders> and reference it from the root logger. For example:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="[%p,%c{1}] %m%n" />
</Console>
<RollingFile name="StartupAppender" fileName="${sys:igrafx.basedirectory}/logs/igrafx_server.log" filePattern="${sys:igrafx.basedirectory}/logs/igrafx_server-%d{yyyy-MM-dd-hh}_%i.log" append="true">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1} - %m%n%throwable"/>
<Policies>
<SizeBasedTriggeringPolicy size="10MB"/>
</Policies>
</RollingFile>
<RollingFile name="CustomAppender" fileName="c:/custom_location/igrafx_server.log" filePattern="c:/custom_location/igrafx_server-%d{yyyy-MM-dd-hh}_%i.log" append="true">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1} - %m%n%throwable"/>
<Policies>
<SizeBasedTriggeringPolicy size="10MB"/>
</Policies>
</RollingFile>
</Appenders>
<Loggers>
<Root level="error">
<AppenderRef ref="Console" />
<AppenderRef ref="StartupAppender" />
<AppenderRef ref="CustomAppender" />
</Root>
<Logger name="com.igrafx.shared.context.ManagerContext" level="info" />
</Loggers>
</Configuration>

Restart the application server after the change.

warning

Don't change or remove the StartupAppender from the <Root> element. When you use a custom log file, changes made under Administration → Support → Logging Settings don't apply to it, and a custom log file can't be viewed under Administration → Support → System Logs.