Просмотр исходного кода

Allow syslog priority configurations per subsystem in logsys.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1568 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake 17 лет назад
Родитель
Сommit
89bd6e3a57
2 измененных файлов с 15 добавлено и 2 удалено
  1. 8 2
      exec/mainconfig.c
  2. 7 0
      man/openais.conf.5

+ 8 - 2
exec/mainconfig.c

@@ -208,7 +208,7 @@ int openais_main_config_read (
 					logsys_logger.priority = LOG_LEVEL_DEBUG;
 				} else
 				if (strcmp (value, "off") == 0) {
-					logsys_logger.priority &= ~LOG_LEVEL_DEBUG;
+					logsys_logger.priority = LOG_LEVEL_INFO;
 				} else {
 					goto parse_error;
 				}
@@ -217,7 +217,13 @@ int openais_main_config_read (
 				if (global_debug)
 					logsys_logger.priority = LOG_LEVEL_DEBUG;
 			}
-
+			if (logsys_logger.priority != LOG_LEVEL_DEBUG) {
+				if (!objdb_get_string (objdb, object_logger_subsys_handle, "syslog_level", &value)) {
+					logsys_logger.priority = logsys_priority_id_get(value);
+					if (logsys_logger.priority < 0)
+						logsys_logger.priority = LOG_LEVEL_INFO;
+				}
+			}
 			if (!objdb_get_string (objdb, object_logger_subsys_handle, "tags", &value)) {
 				char *token = strtok (value, "|");
 

+ 7 - 0
man/openais.conf.5

@@ -494,6 +494,13 @@ This specifies whether debug output is logged for this particular logger.
 
 The default is off.
 
+.TP
+syslog_level
+This specifies the syslog level for this particular subsystem. Ignored if debug is on.
+Possible values are: alert, crit, debug (same as debug = on), emerg, err, info, notice, warning.
+
+The default is: info.
+
 .TP
 tags
 This specifies which tags should be traced for this particular logger.