aboutsummaryrefslogtreecommitdiff
path: root/gnu/services/cuirass.scm
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2020-09-24 11:28:14 +0200
committerMathieu Othacehe <othacehe@gnu.org>2020-09-24 11:28:59 +0200
commit80e26d74294d40f311f61d13996f1ed1aa4d8edd (patch)
treebe3e6b08da9dc6953e3bdcf13a9aa016da0d7c0e /gnu/services/cuirass.scm
parentc5d9cdd91359799354028a461a03950fba6704ef (diff)
downloadguix-80e26d74294d40f311f61d13996f1ed1aa4d8edd.tar
guix-80e26d74294d40f311f61d13996f1ed1aa4d8edd.tar.gz
services: cuirass: Add web SQL queries logging support.
* gnu/services/cuirass.scm (<cuirass-configuration>)[web-queries-log-file]: New field. (cuirass-shepherd-service): Honor it. (cuirass-log-rotations): If defined, add the web queries log file to the log rotation.
Diffstat (limited to 'gnu/services/cuirass.scm')
-rw-r--r--gnu/services/cuirass.scm16
1 files changed, 13 insertions, 3 deletions
diff --git a/gnu/services/cuirass.scm b/gnu/services/cuirass.scm
index 44f40a632c..adf79af8ac 100644
--- a/gnu/services/cuirass.scm
+++ b/gnu/services/cuirass.scm
@@ -56,6 +56,9 @@
(default "/var/log/cuirass-web.log"))
(queries-log-file cuirass-configuration-queries-log-file ;string
(default #f))
+ (web-queries-log-file
+ cuirass-configuration-web-queries-log-file ;string
+ (default #f))
(cache-directory cuirass-configuration-cache-directory ;string (dir-name)
(default "/var/cache/cuirass"))
(ttl cuirass-configuration-ttl ;integer
@@ -90,6 +93,8 @@
(web-log-file (cuirass-configuration-web-log-file config))
(log-file (cuirass-configuration-log-file config))
(queries-log-file (cuirass-configuration-queries-log-file config))
+ (web-queries-log-file
+ (cuirass-configuration-web-queries-log-file config))
(user (cuirass-configuration-user config))
(group (cuirass-configuration-group config))
(interval (cuirass-configuration-interval config))
@@ -147,9 +152,9 @@
"--port" #$(number->string port)
"--listen" #$host
"--interval" #$(number->string interval)
- #$@(if queries-log-file
+ #$@(if web-queries-log-file
(list (string-append "--log-queries="
- queries-log-file))
+ web-queries-log-file))
'())
#$@(if use-substitutes? '("--use-substitutes") '())
#$@(if fallback? '("--fallback") '())
@@ -198,11 +203,16 @@
(define (cuirass-log-rotations config)
"Return the list of log rotations that corresponds to CONFIG."
- (let ((queries-log-file (cuirass-configuration-queries-log-file config)))
+ (let ((queries-log-file (cuirass-configuration-queries-log-file config))
+ (web-queries-log-file
+ (cuirass-configuration-web-queries-log-file config)))
(list (log-rotation
(files `(,(cuirass-configuration-log-file config)
,@(if queries-log-file
(list queries-log-file)
+ '())
+ ,@(if web-queries-log-file
+ (list web-queries-log-file)
'())))
(frequency 'weekly)
(options '("rotate 40")))))) ;worth keeping