Bug 249102 - www/radicale: redirect logging to syslog
Summary: www/radicale: redirect logging to syslog
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Bernhard Froehlich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-04 12:30 UTC by iz-rpi03
Modified: 2020-10-13 08:02 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (decke)


Attachments
Use daemon(8)s options to send stdout, stderr to syslog (462 bytes, text/plain)
2020-09-04 12:30 UTC, iz-rpi03
no flags Details
use daemon(8), syslog.d and newsyslog.d to log to /var/log/radicale and rotate (5.18 KB, patch)
2020-09-27 22:04 UTC, Michael Bueker
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description iz-rpi03 2020-09-04 12:30:59 UTC
Created attachment 217739 [details]
Use daemon(8)s options to send stdout, stderr to syslog

Hello,

as https://radicale.org/3.0.html#documentation/logging documents radicale 3
logs to stderr now.

This could easily verified by rasing radicale's internal log level from
"warning" to "info" and restarting radicale.

I suggest to send stdout and stderr to syslog by using the daemon(8) options.

Regards, Ralf
Comment 1 Bernhard Froehlich freebsd_committer 2020-09-12 18:37:54 UTC
Thanks, it looks like I've missed that. The patch looks okay but I will do a few tests myself before I commit it.
Comment 2 Michael Bueker 2020-09-27 22:04:12 UTC
Created attachment 218372 [details]
use daemon(8), syslog.d and newsyslog.d to log to /var/log/radicale and rotate

I suggest this patch instead, which also modifies the daemon(8) call, but doesn't redirect radicale's log to /var/log/messages. Instead, it uses a dedicated /var/log/radicale that is rotated by newsyslog. Detailed instruction are included in the pkg-message.
Comment 3 Michael Bueker 2020-09-27 22:06:46 UTC
Forgot to mention: patch has been tested in poudriere and works as expected in the jail.
Comment 4 Bernhard Froehlich freebsd_committer 2020-10-12 19:42:37 UTC
(In reply to Michael Bueker from comment #2)
Sorry, but I think you are really overdoing it. It can be as simple as the first patch and does not deserve more complexity than that.
Comment 5 Bernhard Froehlich freebsd_committer 2020-10-12 19:52:17 UTC
Committed. Thanks a lot!
Comment 6 commit-hook freebsd_committer 2020-10-12 19:52:36 UTC
A commit references this bug:

Author: decke
Date: Mon Oct 12 19:51:55 UTC 2020
New revision: 552147
URL: https://svnweb.freebsd.org/changeset/ports/552147

Log:
  www/radicale: Redirect logging to syslog since radicale 3 is now logging to stderr per default

  PR:		249102
  Submitted by:	iz-rpi03@hs-karlsruhe.de

Changes:
  head/www/radicale/Makefile
  head/www/radicale/files/radicale.in
Comment 7 Michael Bueker 2020-10-13 08:02:13 UTC
A note to anyone reading this in the future:

As implemented with this commit, all radicale log messages will always be written to /var/log/messages, because the default syslog priority of messages from daemon(8) is 'notice', and FreeBSD's default /etc/syslog.conf pulls in *.notice to /var/log/messages.

If you set radicale to a verbose log setting like 'info' or 'debug', this will spam your /var/log/messages to hell and back.

In order to avoid this, edit /etc/syslog.conf and add the following negative selector immediately before the line that ends in '/var/log/messages':
!-radicale

You can then create a file like /usr/local/etc/syslog.d/radicale.conf to redirect radicale's output to a file of your choosing, e.g. with the following content:
!radicale
*.* /var/log/radicale