static const int			LOGGER_MAX_FILE_SIZE	= 10 * 1024 * 1024;	// 10 MB
static const int			LOGGER_MAX_NUMBER_FILES	= 10;

void
CreateLogger(const std::string& 				in_categoryName,
			 const std::string& 				in_filename,
			 const log4cpp::Priority::Value		in_priority)
{
	log4cpp::PatternLayout*	layout;
	log4cpp::Appender*		appender;

	// the logging events go to file
	appender = new log4cpp::RollingFileAppender(in_categoryName, 
												in_filename,
												LOGGER_MAX_FILE_SIZE,
												LOGGER_MAX_NUMBER_FILES);
	// the format of the logging events
	layout = new log4cpp::PatternLayout();
	// encode as (ISO date) "yyyymmddTHH:MM:SS.ms category message" 
	layout->setConversionPattern("%d{%Y%m%dT%T.%l} [%p] %m%n");
	appender->setLayout(layout);

	// setup the category we are logging 
	log4cpp::Category& category =
		log4cpp::Category::getInstance(in_categoryName);
	category.setAppender(appender);
	category.setPriority(in_priority);
	
	// appender and layout now belong to category - don't delete!
}

int main(int argc, char *argv[])
{
	log4cpp::Priority::Value	priority = log4cpp::Priority::DEBUG;

	CreateLogger(RTT::Logger::log4cppCategoryName, "orocos-log4cpp.log", priority);

    ...
}
