civodul pushed a commit to branch devel
in repository shepherd.

commit 6be9ef669a4c1fb4a6a0a0fbe2b01c9392c1fb63
Author: Ludovic Courtès <[email protected]>
AuthorDate: Sun Jun 2 16:53:26 2024 +0200

    log-rotation: Honor #:compression.
    
    * modules/shepherd/service/log-rotation.scm (rotate-service-logs):
    Add #:compression and pass it to ‘rotate-logs’.
    (log-rotation-service): Pass #:compression to ‘rotate-service-logs’.
    
    Reported-by: Felix Lechner <[email protected]>
---
 modules/shepherd/service/log-rotation.scm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/shepherd/service/log-rotation.scm 
b/modules/shepherd/service/log-rotation.scm
index 4e217f9..597d62a 100644
--- a/modules/shepherd/service/log-rotation.scm
+++ b/modules/shepherd/service/log-rotation.scm
@@ -149,13 +149,16 @@ each rotation.  If the size of the log file is below
           file rotation-size-threshold)))))
 
 (define* (rotate-service-logs #:optional (rotate rename-file)
-                              #:key (rotation-size-threshold
-                                     (%default-rotation-size-threshold)))
+                              #:key
+                              (compression (%default-log-compression))
+                              (rotation-size-threshold
+                               (%default-rotation-size-threshold)))
   "Rotate the log files of all the currently running services."
   (for-each-service (lambda (service)
                       (match (service-logger service)
                         (#f #f)
                         (logger (rotate-logs logger rotate
+                                             #:compression compression
                                              #:rotation-size-threshold
                                              rotation-size-threshold))))))
 
@@ -202,6 +205,7 @@ only if the service that mounts the file system that hosts 
log files is up."
   (define action
     (lambda ()
       (rotate-service-logs rotate
+                           #:compression compression
                            #:rotation-size-threshold
                            rotation-size-threshold)))
 

Reply via email to