]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mail storage service: Use ioloop log prefix automation.
authorTimo Sirainen <tss@iki.fi>
Fri, 3 Dec 2010 07:00:17 +0000 (07:00 +0000)
committerTimo Sirainen <tss@iki.fi>
Fri, 3 Dec 2010 07:00:17 +0000 (07:00 +0000)
This properly fixes imap/pop3 when using with client_limit>1.

src/lib-storage/mail-storage-service.c

index cd99f50d75151d6e26863ec1ffcea32f3e30758d..3a9db4ef86b6ccae732f308958ac4e5e9f622558 100644 (file)
@@ -530,11 +530,16 @@ mail_storage_service_init_log(struct mail_storage_service_ctx *ctx,
        ctx->log_initialized = TRUE;
        T_BEGIN {
                string_t *str;
+               struct ioloop_log *log;
 
                str = t_str_new(256);
                var_expand(str, user->user_set->mail_log_prefix,
                           get_var_expand_table(ctx->service, &user->input));
                master_service_init_log(ctx->service, str_c(str));
+
+               log = io_loop_log_new(current_ioloop);
+               io_loop_log_set_prefix(log, str_c(str));
+               io_loop_log_unref(&log);
        } T_END;
 }
 
@@ -611,8 +616,10 @@ mail_storage_service_init(struct master_service *service,
        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 */
-               master_service_init_log(service,
-                                       t_strconcat(service->name, ": ", NULL));
+               const char *log_prefix = t_strconcat(service->name, ": ", NULL);
+
+               master_service_init_log(service, log_prefix);
+               io_loop_set_default_log_prefix(current_ioloop, log_prefix);
        }
        dict_drivers_register_builtin();
        return ctx;