summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2023-03-30 06:06:01 +0100
committerAndrew Clayton <a.clayton@nginx.com>2023-04-06 19:42:22 +0100
commitd478eb5eeb53a64b39ff44173fa4b4fd6e224158 (patch)
treee6cb3055823a8ca513f294511ada649e6cc04615
parentdc0a2a721abe133974fa3c5a1afdc4345df640a3 (diff)
downloadunit-d478eb5eeb53a64b39ff44173fa4b4fd6e224158.tar.gz
unit-d478eb5eeb53a64b39ff44173fa4b4fd6e224158.tar.bz2
Handle log-rotation for the per-application logs.applog
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 <alx@nginx.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
-rw-r--r--src/nxt_unit.c6
1 files changed, 6 insertions, 0 deletions
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;