From d478eb5eeb53a64b39ff44173fa4b4fd6e224158 Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Thu, 30 Mar 2023 06:06:01 +0100 Subject: Handle log-rotation for the per-application logs. This commit makes the per-applications logs (if set) partake in logfile rotation. This occurs when the master unit process receives a SIGUSR1. Reviewed-by: Alejandro Colomar Signed-off-by: Andrew Clayton --- src/nxt_unit.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/nxt_unit.c b/src/nxt_unit.c index e1b1897a..965cfa42 100644 --- a/src/nxt_unit.c +++ b/src/nxt_unit.c @@ -8,6 +8,7 @@ #include "nxt_socket_msg.h" #include "nxt_port_queue.h" #include "nxt_app_queue.h" +#include "nxt_application.h" #include "nxt_unit.h" #include "nxt_unit_request.h" @@ -1094,6 +1095,11 @@ nxt_unit_process_msg(nxt_unit_ctx_t *ctx, nxt_unit_read_buf_t *rbuf, goto done; } + if (nxt_app_set_logs() == NXT_ERROR) { + rc = NXT_UNIT_ERROR; + goto done; + } + rc = NXT_UNIT_OK; break; -- cgit