* Guix services, logging, and log rotation
@ 2021-11-17 4:52 Katherine Cox-Buday
2021-11-17 11:40 ` Ludovic Courtès
0 siblings, 1 reply; 2+ messages in thread
From: Katherine Cox-Buday @ 2021-11-17 4:52 UTC (permalink / raw)
To: Guix Devel
Hey Guix!
I'm slowly working on contributing rsyslog with a Guix service. I have just arrived at trying to allow the user to specify where the Shepherd service sends its log file, and I began thinking about log rotation.
In the manual, SS10.8.3, it says:
> (usually, services that produce log files already take care of that)
I found an excellent example in =hpcguix-web-service-type=. It looks like you can achieve this by extending the =rottlog-service-type=?
#+BEGIN_SRC scheme
(define hpcguix-web-service-type
(service-type
(name 'hpcguix-web)
(description "Run the hpcguix-web server.")
(extensions
(list (service-extension account-service-type
(const %hpcguix-web-accounts))
(service-extension activation-service-type
(const %hpcguix-web-activation))
(service-extension rottlog-service-type
(const %hpcguix-web-log-rotations))
(service-extension shepherd-root-service-type
(compose list hpcguix-web-shepherd-service))))))
#+END_SRC
However, I noticed not all services allow users to specify where log files go, or setup log rotation. E.g.:
#+BEGIN_SRC scheme
(define syncthing-service-type
(service-type (name 'syncthing)
(extensions (list (service-extension shepherd-root-service-type
syncthing-shepherd-service)))
(description
"Run @uref{https://github.com/syncthing/syncthing, Syncthing}
decentralized continuous file system synchronization.")))
#+END_SRC
Are these bugs?
Why don't all services allow you to specify where logs go?
I guess if no log location is specified, it just goes in the master shepherd log which is rotated?
Thank you,
--
Katherine
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Guix services, logging, and log rotation
2021-11-17 4:52 Guix services, logging, and log rotation Katherine Cox-Buday
@ 2021-11-17 11:40 ` Ludovic Courtès
0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2021-11-17 11:40 UTC (permalink / raw)
To: Katherine Cox-Buday; +Cc: Guix Devel
Hi,
Katherine Cox-Buday <cox.katherine.e@gmail.com> skribis:
> In the manual, SS10.8.3, it says:
>
>> (usually, services that produce log files already take care of that)
>
> I found an excellent example in =hpcguix-web-service-type=. It looks like you can achieve this by extending the =rottlog-service-type=?
Yes (info "(guix) Log Rotation").
> However, I noticed not all services allow users to specify where log files go, or setup log rotation. E.g.:
>
> #+BEGIN_SRC scheme
> (define syncthing-service-type
> (service-type (name 'syncthing)
> (extensions (list (service-extension shepherd-root-service-type
> syncthing-shepherd-service)))
> (description
> "Run @uref{https://github.com/syncthing/syncthing, Syncthing}
> decentralized continuous file system synchronization.")))
> #+END_SRC
>
> Are these bugs?
>
> Why don't all services allow you to specify where logs go?
I think these are omissions rather than bugs. But really, each daemon
has its own way of dealing with logging: some write to syslog (in which
case we don’t need to add a new log rotation rule), some just write to
stderr (like hpcguix-web, and in this case you need to pass #:log-file
to ‘make-forkexec-constructor’), some write to custom log files that may
or may not be configurable.
I think it’s nice in general for services to provide log rotation
entries, especially when they’re likely to produce verbose logs.
HTH,
Ludo’.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-11-17 11:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-17 4:52 Guix services, logging, and log rotation Katherine Cox-Buday
2021-11-17 11:40 ` Ludovic Courtès
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.