git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lucas Werkmeister <mail@lucaswerkmeister.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH] daemon: add --no-syslog to undo implicit --syslog
Date: Wed, 24 Jan 2018 20:48:20 +0100	[thread overview]
Message-ID: <740d5b61-884d-76df-a226-9d8a1245f528@lucaswerkmeister.de> (raw)
In-Reply-To: <xmqqtvvbds42.fsf@gitster.mtv.corp.google.com>

On 24.01.2018 19:33, Junio C Hamano wrote:
> Lucas Werkmeister <mail@lucaswerkmeister.de> writes:
> 
>>> Moreover, --detach completely dissociates the process from the
>>> original set of standard file descriptors by first closing them and
>>> then connecting it to "/dev/null", so it will be nonsense to use this
>>> new option with it.
>>
>> Ah, I wasn’t aware of that – so with --detach, --no-syslog would be
>> better described as “disables all logging” rather than “log to stderr
>> instead”. IMHO it would still make sense to have the --no-syslog option
>> (then mainly for use with --inetd) as long as its interaction with
>> --inetd is properly documented.
> 
> Because "--detach --no-syslog" is a roundabout way to ask for
> sending the log to _nowhere_, I actually would say that "nonsense"
> is a bit too strong a word for the combination of your thing with
> "--detach".
> 
> It might make more sense to introduce a new "--send-log-to=<dest>"
> option, where the destination can be one of: syslog, stderr, none.
> 
> The you can make the current "--syslog" option a synonym to
> "--send-log-to=syslog".  The internal variable log_syslog would
> probably become
> 
> 	enum log_destination { 
> 		LOG_TO_NONE = -1,
> 		LOG_TO_STDERR = 0,
> 		LOG_TO_SYSLOG = 1,
> 	} log_destination;
> 
> and wherever the current code assigns 1 to log_syslog, you would be
> setting it LOG_TO_SYSLOG.
> 
> Then those who want no log can express that wish in a more direct
> way, i.e. "daemon --send-log-to=none", perhaps.
> 
> Such an approach leaves open room for future enhancement.  It is not
> too far-fetched to imagine something like:
> 
> 	git daemon --send-log-to=/var/log/git-daemon.log
> 
> by introducing the fourth value to "enum log_destination"; perhaps
> the file is opened and connected to stderr to accept the logs,
> combined with a new feature that tells the daemon to close and
> reopen the log file when it receives a HUP or something like that.

Sounds interesting… do you think it would be worth it supporting
multiple destinations? Right now this could be implemented fairly easily
by making log_destination a bit field (and --syslog would then imply
--send-log-to=syslog --no-send-log-to=stderr or something like that). On
the other hand, that doesn’t allow for this nice trick of reusing the
stderr fd for a log file in case of future enhancement.

  reply	other threads:[~2018-01-24 19:48 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-22 23:23 [PATCH] daemon: add --no-syslog to undo implicit --syslog Lucas Werkmeister
2018-01-23  0:00 ` Ævar Arnfjörð Bjarmason
2018-01-23 18:30   ` Junio C Hamano
2018-01-23 22:06     ` Lucas Werkmeister
2018-01-24 10:05       ` Lucas Werkmeister
2018-01-24 18:33       ` Junio C Hamano
2018-01-24 19:48         ` Lucas Werkmeister [this message]
2018-01-27 18:31         ` [PATCH v2] daemon: add --send-log-to=(stderr|syslog|none) Lucas Werkmeister
2018-01-28  6:40           ` Eric Sunshine
2018-01-28 22:58             ` Lucas Werkmeister
2018-01-29  0:10               ` Eric Sunshine
2018-02-03 23:08                 ` [PATCH v3] daemon: add --log-destination=(stderr|syslog|none) Lucas Werkmeister
2018-02-04  6:36                   ` Eric Sunshine
2018-02-04 18:29                     ` Lucas Werkmeister
2018-02-04 18:30                       ` [PATCH v4] " Lucas Werkmeister
2018-02-04 18:55                         ` Ævar Arnfjörð Bjarmason
2018-02-04 18:58                           ` Lucas Werkmeister
2018-02-05 20:09                             ` Ævar Arnfjörð Bjarmason
2018-02-04 19:44                           ` Eric Sunshine
2018-02-04 19:36                         ` Eric Sunshine
2018-02-05 18:31                           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=740d5b61-884d-76df-a226-9d8a1245f528@lucaswerkmeister.de \
    --to=mail@lucaswerkmeister.de \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).