if (director->test_port != 0) {
/* we're testing, possibly writing to same log file.
make it clear which director we are. */
- master_service_init_log(master_service,
+ master_service_init_log_with_prefix(master_service,
t_strdup_printf("director(%s): ",
net_ip2addr(&director->self_ip)));
}
user->log_prefix = p_strdup(user->pool, str_c(str));
} T_END;
- master_service_init_log(ctx->service, user->log_prefix);
+ master_service_init_log_with_prefix(ctx->service, user->log_prefix);
/* replace the whole log prefix with mail_log_prefix */
event_replace_log_prefix(user->event, user->log_prefix);
if ((flags & MAIL_STORAGE_SERVICE_FLAG_NO_LOG_INIT) == 0) {
/* note: we may not have read any settings yet, so this logging
may still be going to wrong location */
+ const char *configured_name =
+ master_service_get_configured_name(service);
ctx->default_log_prefix =
- p_strconcat(pool, service->name, ": ", NULL);
- master_service_init_log(service, ctx->default_log_prefix);
+ p_strconcat(pool, configured_name, ": ", NULL);
+ master_service_init_log_with_prefix(service, ctx->default_log_prefix);
}
dict_drivers_register_builtin();
if (storage_service_global == NULL)
!ctx->log_initialized) {
/* initialize logging again, in case we only read the
settings for the first above */
+ const char *configured_name =
+ master_service_get_configured_name(ctx->service);
ctx->log_initialized = TRUE;
- master_service_init_log(ctx->service,
- t_strconcat(ctx->service->name, ": ", NULL));
+ master_service_init_log_with_prefix(ctx->service,
+ t_strconcat(configured_name, ": ", NULL));
update_log_prefix = TRUE;
}
sets = master_service_settings_parser_get_others(master_service,
sig_reopen_logs(const siginfo_t *si ATTR_UNUSED, void *context ATTR_UNUSED)
{
master_service->log_initialized = FALSE;
- master_service_init_log(master_service, global_log_prefix);
+ master_service_init_log_with_prefix(master_service, global_log_prefix);
}
static void main_init(void)
if (master_service_settings_read_simple(master_service,
NULL, &error) < 0)
i_fatal("Error reading configuration: %s", error);
- master_service_init_log(master_service, global_log_prefix);
+ master_service_init_log_with_prefix(master_service, global_log_prefix);
verbose_proctitle = master_service_settings_get(master_service)->verbose_proctitle;
}
env_put(t_strconcat(ENV_USERDB_KEYS"=", str_c(keys), NULL));
- master_service_init_log(master_service,
+ master_service_init_log_with_prefix(master_service,
t_strdup_printf("script-login(%s): ", input.username));
if (drop_to_userdb_privileges) {