repmgr: always log to STDERR even if log facility defined

This commit is contained in:
Ian Barwick
2016-11-23 08:55:55 +09:00
parent 26f73686e5
commit b54f98ed8a
6 changed files with 19 additions and 10 deletions

9
log.c
View File

@@ -142,7 +142,7 @@ log_verbose(int level, const char *fmt, ...)
bool
logger_init(t_configuration_options *opts, const char *ident)
logger_init(t_configuration_options *opts, const char *ident, bool stderr_only)
{
char *level = opts->loglevel;
char *facility = opts->logfacility;
@@ -176,6 +176,13 @@ logger_init(t_configuration_options *opts, const char *ident)
stderr_log_warning(_("Invalid log level \"%s\" (available values: DEBUG, INFO, NOTICE, WARNING, ERR, ALERT, CRIT or EMERG)\n"), level);
}
/*
* STDERR only logging requested - finish here without setting up any further
* logging facility.
*/
if (stderr_only == true)
return true;
if (facility && *facility)
{