Message ID | 91683e6a6059df7816833d4e4d1e3bfc43aa74e7.1716386553.git.ludo@gnu.org |
---|---|
State | New |
Headers | show |
Series | More service logging to stderr | expand |
Hi Ludovic, Ludovic Courtès <ludo@gnu.org> writes: > * gnu/services/base.scm (<nscd-configuration>)[log-file]: Default to #f. > * doc/guix.texi (Base Services): Clarify documentation. > > Change-Id: Ia75914fc2665db13bef688d53659083a615ebef4 > --- > doc/guix.texi | 8 +++++--- > gnu/services/base.scm | 2 +- > 2 files changed, 6 insertions(+), 4 deletions(-) > > diff --git a/doc/guix.texi b/doc/guix.texi > index 8073e3f6d49..0055724e658 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -19446,9 +19446,11 @@ Base Services > Package object denoting the GNU C Library providing the @command{nscd} > command. > > -@item @code{log-file} (default: @code{"/var/log/nscd.log"}) > -Name of the nscd log file. This is where debugging output goes when > -@code{debug-level} is strictly positive. > +@item @code{log-file} (default: @code{#f}) > +Name of the nscd log file. Debugging output goes to that file when > +@code{debug-level} is strictly positive, or to standard error if it is > +@code{#f}. Regular messages are written to syslog when > +@code{debug-level} is zero, regardless of the value of @code{log-file}. Is it not a bit counter-intuitive, to have a 'log-file' field that users can set, but debug logs not going there? Perhaps we should get rid of it entirely instead?
Hi Ludo, Ludovic Courtès <ludo@gnu.org> writes: > * gnu/services/base.scm (<nscd-configuration>)[log-file]: Default to #f. > * doc/guix.texi (Base Services): Clarify documentation. > > Change-Id: Ia75914fc2665db13bef688d53659083a615ebef4 > --- > doc/guix.texi | 8 +++++--- > gnu/services/base.scm | 2 +- > 2 files changed, 6 insertions(+), 4 deletions(-) > > diff --git a/doc/guix.texi b/doc/guix.texi > index 8073e3f6d49..0055724e658 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -19446,9 +19446,11 @@ Base Services > Package object denoting the GNU C Library providing the @command{nscd} > command. > > -@item @code{log-file} (default: @code{"/var/log/nscd.log"}) > -Name of the nscd log file. This is where debugging output goes when > -@code{debug-level} is strictly positive. > +@item @code{log-file} (default: @code{#f}) > +Name of the nscd log file. Debugging output goes to that file when > +@code{debug-level} is strictly positive, or to standard error if it is > +@code{#f}. Regular messages are written to syslog when > +@code{debug-level} is zero, regardless of the value of @code{log-file}. My initial reading of the above was wrong. I guess it's fine, though I find the special case logging to /dev/error when debug-level == 0 despite log-file being set a bit surprising still.
Hi, Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis: > Ludovic Courtès <ludo@gnu.org> writes: > >> * gnu/services/base.scm (<nscd-configuration>)[log-file]: Default to #f. >> * doc/guix.texi (Base Services): Clarify documentation. >> >> Change-Id: Ia75914fc2665db13bef688d53659083a615ebef4 [...] >> +@item @code{log-file} (default: @code{#f}) >> +Name of the nscd log file. Debugging output goes to that file when >> +@code{debug-level} is strictly positive, or to standard error if it is >> +@code{#f}. Regular messages are written to syslog when >> +@code{debug-level} is zero, regardless of the value of @code{log-file}. > > Is it not a bit counter-intuitive, to have a 'log-file' field that users > can set, but debug logs not going there? Yeah, I had to check the code of nscd in libc, and it’s this weird. > Perhaps we should get rid of it entirely instead? I’d rather keep it to avoid gratuitous breakage and also because it’s occasionally useful when one needs to debug NSS/nscd issues. Ludo’.
Hi, Ludovic Courtès <ludo@gnu.org> writes: > Hi, > > Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis: > >> Ludovic Courtès <ludo@gnu.org> writes: >> >>> * gnu/services/base.scm (<nscd-configuration>)[log-file]: Default to #f. >>> * doc/guix.texi (Base Services): Clarify documentation. >>> >>> Change-Id: Ia75914fc2665db13bef688d53659083a615ebef4 > > [...] > >>> +@item @code{log-file} (default: @code{#f}) >>> +Name of the nscd log file. Debugging output goes to that file when >>> +@code{debug-level} is strictly positive, or to standard error if it is >>> +@code{#f}. Regular messages are written to syslog when >>> +@code{debug-level} is zero, regardless of the value of @code{log-file}. >> >> Is it not a bit counter-intuitive, to have a 'log-file' field that users >> can set, but debug logs not going there? > > Yeah, I had to check the code of nscd in libc, and it’s this weird. Haha! >> Perhaps we should get rid of it entirely instead? > > I’d rather keep it to avoid gratuitous breakage and also because it’s > occasionally useful when one needs to debug NSS/nscd issues. OK. Sounds reasonable. I didn't know the weirdness was carried from the underlying software rather than our own.
diff --git a/doc/guix.texi b/doc/guix.texi index 8073e3f6d49..0055724e658 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19446,9 +19446,11 @@ Base Services Package object denoting the GNU C Library providing the @command{nscd} command. -@item @code{log-file} (default: @code{"/var/log/nscd.log"}) -Name of the nscd log file. This is where debugging output goes when -@code{debug-level} is strictly positive. +@item @code{log-file} (default: @code{#f}) +Name of the nscd log file. Debugging output goes to that file when +@code{debug-level} is strictly positive, or to standard error if it is +@code{#f}. Regular messages are written to syslog when +@code{debug-level} is zero, regardless of the value of @code{log-file}. @item @code{debug-level} (default: @code{0}) Integer denoting the debugging levels. Higher numbers mean that more diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 85160bd3abb..984670cd32c 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1285,7 +1285,7 @@ (define-record-type* <nscd-configuration> nscd-configuration make-nscd-configuration nscd-configuration? (log-file nscd-configuration-log-file ;string - (default "/var/log/nscd.log")) + (default #f)) (debug-level nscd-debug-level ;integer (default 0)) ;; TODO: See nscd.conf in glibc for other options to add.