}
i_set_failure_prefix("%s", prefix);
i_log_type(ctx, "%s", text);
- i_set_failure_prefix("log: ");
+ i_set_failure_prefix("%s", global_log_prefix);
}
static void
#include "lib.h"
#include "lib-signals.h"
+#include "hostpid.h"
#include "restrict-access.h"
#include "master-interface.h"
#include "master-service.h"
#include <unistd.h>
bool verbose_proctitle;
+const char *global_log_prefix;
static struct log_error_buffer *errorbuf;
static void
sig_reopen_logs(const siginfo_t *si ATTR_UNUSED, void *context ATTR_UNUSED)
{
- master_service_init_log(master_service, "log: ");
+ master_service_init_log(master_service, global_log_prefix);
}
static void main_init(void)
/* use log prefix and log to stderr until we've configured the real
logging */
- i_set_failure_file("/dev/stderr", "log: ");
+ global_log_prefix = t_strdup_printf("log(%s): ", my_pid);
+ i_set_failure_file("/dev/stderr", global_log_prefix);
if (master_getopt(master_service) > 0)
return FATAL_DEFAULT;
if (master_service_settings_read_simple(master_service,
NULL, &error) < 0)
i_fatal("Error reading configuration: %s", error);
- master_service_init_log(master_service, "log: ");
+ master_service_init_log(master_service, global_log_prefix);
verbose_proctitle = master_service_settings_get(master_service)->verbose_proctitle;