mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-07-27 03:00:52 +00:00
Allow the syslog facility type to be set in the configuration file.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1029 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
parent
8a55ef585e
commit
1948867924
@ -167,6 +167,39 @@ int openais_main_config_read (
|
||||
}
|
||||
}
|
||||
|
||||
if (!objdb_get_string (objdb,object_service_handle, "syslog_facility", &value)) {
|
||||
if (strcmp (value, "daemon") == 0) {
|
||||
main_config->syslog_facility = LOG_DAEMON;
|
||||
} else
|
||||
if (strcmp (value, "local0") == 0) {
|
||||
main_config->syslog_facility = LOG_LOCAL0;
|
||||
} else
|
||||
if (strcmp (value, "local1") == 0) {
|
||||
main_config->syslog_facility = LOG_LOCAL1;
|
||||
} else
|
||||
if (strcmp (value, "local2") == 0) {
|
||||
main_config->syslog_facility = LOG_LOCAL2;
|
||||
} else
|
||||
if (strcmp (value, "local3") == 0) {
|
||||
main_config->syslog_facility = LOG_LOCAL3;
|
||||
} else
|
||||
if (strcmp (value, "local4") == 0) {
|
||||
main_config->syslog_facility = LOG_LOCAL4;
|
||||
} else
|
||||
if (strcmp (value, "local5") == 0) {
|
||||
main_config->syslog_facility = LOG_LOCAL5;
|
||||
} else
|
||||
if (strcmp (value, "local6") == 0) {
|
||||
main_config->syslog_facility = LOG_LOCAL6;
|
||||
} else
|
||||
if (strcmp (value, "local7") == 0) {
|
||||
main_config->syslog_facility = LOG_LOCAL7;
|
||||
} else {
|
||||
error_reason = "unknown syslog facility specified";
|
||||
goto parse_error;
|
||||
}
|
||||
}
|
||||
|
||||
while ( objdb->object_find (object_service_handle,
|
||||
"logger",
|
||||
strlen ("logger"),
|
||||
@ -258,6 +291,9 @@ int openais_main_config_read (
|
||||
goto parse_error;
|
||||
}
|
||||
|
||||
if (!main_config->syslog_facility)
|
||||
main_config->syslog_facility = LOG_DAEMON;
|
||||
|
||||
return 0;
|
||||
|
||||
parse_error:
|
||||
|
@ -66,6 +66,7 @@ struct main_config {
|
||||
*/
|
||||
int logmode;
|
||||
char *logfile;
|
||||
int syslog_facility;
|
||||
|
||||
/* user/group to run as */
|
||||
char *user;
|
||||
|
@ -224,6 +224,10 @@ int log_setup (char **error_string, struct main_config *config)
|
||||
}
|
||||
}
|
||||
|
||||
if (config->logmode & LOG_MODE_SYSLOG) {
|
||||
openlog("openais", LOG_CONS|LOG_PID, config->syslog_facility);
|
||||
}
|
||||
|
||||
/*
|
||||
** reinit all loggers that has initialised before log_setup() was called.
|
||||
*/
|
||||
|
@ -381,6 +381,14 @@ This specifies that file and line should be printed instead of logger name.
|
||||
|
||||
The default is off.
|
||||
|
||||
.TP
|
||||
syslog_facility
|
||||
This specifies the syslog facility type that will be used for any messages
|
||||
sent to syslog. options are daemon, local0, local1, local2, local3, local4,
|
||||
local5, local6 & local7.
|
||||
|
||||
The default is daemon.
|
||||
|
||||
.PP
|
||||
.PP
|
||||
Within the
|
||||
|
Loading…
Reference in New Issue
Block a user