mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 05:48:07 -05:00
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.
This commit is contained in:
parent
c5d9cdd913
commit
80e26d7429
2 changed files with 17 additions and 3 deletions
|
@ -23908,6 +23908,10 @@ Location of the log file used by the web interface.
|
|||
Location of the SQL queries log file. By default, SQL queries logging is
|
||||
disabled.
|
||||
|
||||
@item @code{web-queries-log-file} (default: @code{#f})
|
||||
Location of the web SQL queries log file. By default, web SQL queries
|
||||
logging is disabled.
|
||||
|
||||
@item @code{cache-directory} (default: @code{"/var/cache/cuirass"})
|
||||
Location of the repository cache.
|
||||
|
||||
|
|
|
@ -56,6 +56,9 @@ (define-record-type* <cuirass-configuration>
|
|||
(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 @@ (define (cuirass-shepherd-service config)
|
|||
(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 @@ (define (cuirass-shepherd-service config)
|
|||
"--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-activation config)
|
|||
|
||||
(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
|
||||
|
|
Loading…
Reference in a new issue