log4cxx::LayoutPtr layout =\r
new log4cxx::PatternLayout(LOGGER_LAYOUT);\r
\r
- for( category_level_map_type::iterator cat_itr = category_level_map.begin();\r
- cat_itr != category_level_map.end();\r
- ++cat_itr ){\r
-\r
- category_name_map_type::iterator name_itr = category_name_map.find( cat_itr->first );\r
- log4cxx::LoggerPtr cat_logger = log4cxx::Logger::getLogger( name_itr->second );\r
- if (0 == cat_logger) {\r
- throw std::logic_error("getLogger Failed.");\r
- }\r
+ log4cxx::rolling::RollingFileAppenderPtr normalAppender;\r
+ log4cxx::rolling::RollingFileAppenderPtr accessAppender;\r
+ \r
+ for( int appender_count = 0 ; appender_count < 2; ++appender_count ){\r
+ if( "" == property->log_filename_key ) break; // no conn_log setting.\r
\r
-#if defined(LOGGER_PROCESS_VSD)\r
- if( cat_itr->first == LOG_CAT_L7VSD_NETWORK_ACCESS )\r
- property = &access_log_property;\r
- else\r
+ if( 0 == appender_count )\r
property = &normal_log_property;\r
-#elif defined(LOGGER_PROCESS_ADM)\r
- property = &normal_log_property;\r
-#elif defined(LOGGER_PROCESS_SNM)\r
- property = &normal_log_property;\r
-#elif defined(LOGGER_PROCESS_SSL)\r
- if( cat_itr->first == LOG_CAT_SSLPROXY_CONNECTION )\r
- property = &access_log_property;\r
else\r
- property = &normal_log_property;\r
-#else\r
- property = &normal_log_property;\r
-#endif\r
+ property = &access_log_property;\r
\r
switch (property->rotation_value) {\r
case LOG_ROT_SIZE:\r
sizeAppender->activateOptions(pool);\r
\r
// add size_base_appender to CategoryLogger\r
- cat_logger->addAppender(sizeAppender);\r
- \r
+ //cat_logger->addAppender(sizeAppender);\r
+ if( 0 == appender_count )\r
+ normalAppender = sizeAppender;\r
+ else\r
+ accessAppender = sizeAppender;\r
+\r
break;\r
}\r
case LOG_ROT_DATE:\r
dateAppender->activateOptions(pool);\r
\r
// add date_based_appender to CategoryLogger\r
- cat_logger->addAppender(dateAppender);\r
- \r
+ //cat_logger->addAppender(dateAppender);\r
+ if( 0 == appender_count )\r
+ normalAppender = dateAppender;\r
+ else\r
+ accessAppender = dateAppender;\r
+\r
break;\r
}\r
default: //LOG_ROT_DATESIZE:\r
dateSizeAppender->activateOptions(pool);\r
\r
// add time_and_size_based_appender to CategoryLogger\r
- cat_logger->addAppender(dateSizeAppender);\r
+ //cat_logger->addAppender(dateSizeAppender);\r
+ if( 0 == appender_count )\r
+ normalAppender = dateSizeAppender;\r
+ else\r
+ accessAppender = dateSizeAppender;\r
+\r
}\r
} //switch\r
+ } //for \r
+\r
+ for( category_level_map_type::iterator cat_itr = category_level_map.begin();\r
+ cat_itr != category_level_map.end();\r
+ ++cat_itr ){\r
+\r
+ category_name_map_type::iterator name_itr = category_name_map.find( cat_itr->first );\r
+ log4cxx::LoggerPtr cat_logger = log4cxx::Logger::getLogger( name_itr->second );\r
+ if (0 == cat_logger) {\r
+ throw std::logic_error("getLogger Failed.");\r
+ }\r
+\r
+#if defined(LOGGER_PROCESS_VSD)\r
+ if( cat_itr->first == LOG_CAT_L7VSD_NETWORK_ACCESS ){\r
+ //property = &access_log_property;\r
+ cat_logger->addAppender(accessAppender);\r
+ }\r
+ else{\r
+ //property = &normal_log_property;\r
+ cat_logger->addAppender(normalAppender);\r
+ }\r
+#elif defined(LOGGER_PROCESS_ADM)\r
+ //property = &normal_log_property;\r
+ cat_logger->addAppender(normalAppender);\r
+#elif defined(LOGGER_PROCESS_SNM)\r
+ //property = &normal_log_property;\r
+ cat_logger->addAppender(normalAppender);\r
+#elif defined(LOGGER_PROCESS_SSL)\r
+ if( cat_itr->first == LOG_CAT_SSLPROXY_CONNECTION ){\r
+ //property = &access_log_property;\r
+ cat_logger->addAppender(accessAppender);\r
+ }\r
+ else{\r
+ //property = &normal_log_property;\r
+ cat_logger->addAppender(normalAppender);\r
+ }\r
+#else\r
+ //property = &normal_log_property;\r
+ cat_logger->addAppender(normalAppender);\r
+#endif\r
+\r
\r
//default log level settting\r
cat_itr->second = LOG_LV_INFO;\r