Skip to content

log4j2.xml ​

The file "log4j2.xml" located in your /<indexima_install_folder>/galactica/conf folder is used to configure the Indexima logs.

It is recommended to use the template present in the indexima installer package.

xml
<?xml version="1.0" encoding="UTF-8"?>
<Configuration monitorInterval="30">
	<Properties>
		<Property name="LOG_PATTERN">%d{yyyy-MM-dd_HH:mm:ss} %5p [%t] %c - %m%n</Property>
	</Properties>
	<Appenders>
		<!-- Default appender in console. Only STDOUT -->
		<Console name="ConsoleAppender" target="SYSTEM_OUT">
			<PatternLayout pattern="${LOG_PATTERN}"/>
		</Console>

		<!-- File appender with 100MB / day. The  property log4j2.logFolder is set into galactica -->
		<RollingFile name="FileAppender" fileName="${sys:log4j2.logFolder}/indexima_current.log"
					 filePattern="${sys:log4j2.logFolder}/indexima_%d{yyyy-MM-dd}.log" append="true" createOnDemand="true">
			<PatternLayout pattern="${LOG_PATTERN}" />
			<Policies>
				<TimeBasedTriggeringPolicy interval="1" />
				<SizeBasedTriggeringPolicy size="100 MB"/>
			</Policies>
			<DefaultRolloverStrategy max="2" compressionLevel="0">
				<!-- old files deleted hen age > 7 days -->
				<Delete basePath="${sys:log4j2.logFolder}" >
         	 		<IfLastModified age="7d" />
					<IfFileName glob="indexima_*.log" />
       			</Delete>
			</DefaultRolloverStrategy>
		</RollingFile>
		<!-- Create an async appender for logs file -->
		<Async name="AsyncFileAppender">
			<AppenderRef ref="FileAppender"/>
		</Async>
		<!-- Create an async appender for console logs -->
		<Async name="AsyncConsoleAppender">
			<AppenderRef ref="ConsoleAppender"/>
		</Async>
	</Appenders>
	<Loggers>
		<!-- Default configuration -->
		<Root level="INFO">
			<AppenderRef ref="AsyncFileAppender"/>
		</Root>
		<!-- Default configuration -->
		<Logger name="org.apache.commons.jcs" level="WARN" additivity="false">
			<AppenderRef ref="AsyncFileAppender"/>
		</Logger>
		<!-- Yarn launcher goes to console. -->
		 <Logger name="io.galactica.yarn" level="INFO" additivity="false">
			<AppenderRef ref="AsyncConsoleAppender"/>
		</Logger>
		<!-- Console Logger. Do not change. -->
		<Logger name="INDEXIMA_CONSOLE" level="INFO" additivity="false">
			<AppenderRef ref="AsyncConsoleAppender"/>
		</Logger>
		<!-- Monitoring Logger. Do not change. -->
		<Logger name="INDEXIMA_MONITOR" level="INFO" additivity="false">
			<AppenderRef ref="AsyncConsoleAppender"/>
		</Logger>
	</Loggers>
</Configuration>

Base configuration ​

This will write logs in a file located in the folder specified by the property log.dir in the galactica.conf configuration file.

The current log file is named indexima_current.log.

Every day, it rotates the file to a new one, and save the previous file with the corresponding date.

Log History ​

The property <IfLastModified age= allows you to change the default maximum log history. Default is 7 days.

Loggers ​

5 loggers are configured.

Root logger ​

This is the base logger, logging 90% of the events in Galactica. It is recommended to keep it on level=INFO. If you need a more detailed log for a specific reason, you can change it to DEBUG. If you do this, don't forget to put it back to INFO once you found what you are looking for.

Apache JCS ​

An additional logger for common modules by Apache.

Yarn ​

Yarn logs if you use YARN deployment.

Indexima Console ​

Logs related to Indexima Console. By default, it is written on the terminal.

Indexima Monitoring ​

Logs related to Indexima SQL queries. All queries sent to Indexima are logged. By default, it is written on the terminal.

To go further ​

If you want to customize your logging experience, please refer to the official Apache documentation: https://logging.apache.org/log4j/2.x/.