Logging

You can easily establish enhanced logging for your Data Hub installation by modifying your logback.xml file in runtime.

You can provide a custom logback.xml file in the following two ways:

  1. At the application level: Your datahub-webapp.war file contains the logback.xml file. When the WAR file is exploded, the logback.xml moves to webapps/datahub-webapp-some.version/WEB-INF/classes/logback.xml.
  2. At the Tomcat level by doing one of the following:
    • Add a custom log file with the name logback-test.xml in apache-tomcat-x.x.xx/settings/.
    • Overwrite the logback file location with parameter logback.configurationFile=file:/<full_path_of_tomcat>/apache-tomcat-x.x.xx/settings/logback.xml in apache-tomcat-x.x.xx/conf/catalina.properties.

If Data Hub is running and you must modify the log settings, just open the logback.xml file, make your changes, and save the file. The changes are implemented in a moment or so.

The following is a sample logback.xmlfile.

<configuration scan="true" scanPeriod="30 seconds">
	<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
		<encoder>
			<pattern>%d [%level] [%logger{20}] %msg%n</pattern>
		</encoder>
	</appender>

	<logger name="com.hybris.kernel" level="info" />
	<logger name="com.hybris.kernel.typesystem" level="info" />

	<logger name="com.hybris.datahub.config.SystemInformationLogger" level="info"/>
	<logger name="com.hybris.datahub" level="debug" />
	<logger name="com.hybris.datahub.jms.CustomMessageListenerContainer" level="info" />
	<logger name="com.hybris.datahub.jms.MultiDestinationJmsTemplate" level="info" />
	<logger name="com.hybris.datahub.service.integration.impl" level="info" />
	<logger name="org.springframework" level="info" />
	<logger name="org.springframework.integration.handler.LoggingHandler" level="warn" />
	<logger name="org.reflections.Reflections" level="off" />
	<logger name="org.hibernate" level="info" />
	<logger name="org.hibernate.engine.jdbc.spi" level="error" />
	<logger name="org.hibernate.engine.internal" level="error" />
	<logger name="akka" level="debug" />
	<!-- set the level to info to see more details on the deleted publication retries -->
	<!-- TODO: Uncomment netty logging for development only -->
	<!--<logger name="io.netty.handler.logging.LoggingHandler" level="debug" />-->
	<logger name="com.hybris.datahub.service.publication.impl.DeletePublicationRetryEventListener" level="WARN" />
	<logger name="com.hybris.charon" level="ERROR" />
	<root level="warn">
		<appender-ref ref="STDOUT" />
	</root>
	<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
		<resetJUL>true</resetJUL>
	</contextListener>
</configuration>