Google

Locations of visitors to this page

Logging

Antidoto uses log4j as logging API. The problem with modularization and log4j is simply that it not possible.

ti-core provides a simple way to distribute log4j configuration. The current implementation only distributes the configuration of logging levels of categories, more configuratio option can be implemented as they are needed.

The basic idea here is, that every module can define the logging category and loglevel for its own codebase, without having to provide a full blown log4j configuration.

The distributed configuration is done in spring context files, as shown in the example below:

<?xml version="1.0" encoding="utf-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:tiCore="http://antidoto.sf.net/subsystem/ti-core"
	xsi:schemaLocation="
	http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
	http://antidoto.sf.net/subsystem/ti-core http://antidoto.sf.net/xsd/ti-core.xsd
	">
	
	<tiCore:logger 
		category="org.springframework" 
		loglevel="DEBUG" />
		
	<tiCore:logger 
		category="de.pgt.ti.core" 
		loglevel="DEBUG" />

	<tiCore:logger 
		category="some.test.category" 
		loglevel="ERROR" />
		
</beans>
			

The configuration elements are self explanatory. More information about the log4J can be found on the project site: Log4J project site

The main log4j.xml configuration is provided by ti-core, but can be overriden by other subsystems.