]> git.ipfire.org Git - thirdparty/git.git/commit - Documentation/git-daemon.txt
daemon: add --log-destination=(stderr|syslog|none)
authorLucas Werkmeister <mail@lucaswerkmeister.de>
Sun, 4 Feb 2018 18:30:37 +0000 (19:30 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 5 Feb 2018 18:30:44 +0000 (10:30 -0800)
commit0c591cacba00a36af797fa3b6c4a4f12d342be86
tree18c61e2728baa710c373febf240cac6f021d97f6
parent8279ed033f703d4115bee620dccd32a9ec94d9aa
daemon: add --log-destination=(stderr|syslog|none)

This new option can be used to override the implicit --syslog of
--inetd, or to disable all logging. (While --detach also implies
--syslog, --log-destination=stderr with --detach is useless since
--detach disassociates the process from the original stderr.) --syslog
is retained as an alias for --log-destination=syslog.

--log-destination always overrides implicit --syslog regardless of
option order. This is different than the “last one wins” logic that
applies to some implicit options elsewhere in Git, but should hopefully
be less confusing. (I also don’t know if *all* implicit options in Git
follow “last one wins”.)

The combination of --inetd with --log-destination=stderr is useful, for
instance, when running `git daemon` as an instanced systemd service
(with associated socket unit). In this case, log messages sent via
syslog are received by the journal daemon, but run the risk of being
processed at a time when the `git daemon` process has already exited
(especially if the process was very short-lived, e.g. due to client
error), so that the journal daemon can no longer read its cgroup and
attach the message to the correct systemd unit (see systemd/systemd#2913
[1]). Logging to stderr instead can solve this problem, because systemd
can connect stderr directly to the journal daemon, which then already
knows which unit is associated with this stream.

[1]: https://github.com/systemd/systemd/issues/2913

Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Lucas Werkmeister <mail@lucaswerkmeister.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-daemon.txt
daemon.c