git-daemon的日志保存在哪里? (在使用Cygwin的Windows上的Git) [英] Where are logs of git-daemon saved? (Git on windows using Cygwin)
问题描述
服务中使用的命令是:git daemon --reuseaddr --base-path = / data / test_work / --export-all --verbose --enable = receive-pack
在哪里可以看到git守护进程的日志?
注意:/ var / logs中没有文件。 / b>
在哪里可以看到git守护进程的日志? / blockquote>
Git 2.17(Q1 2018)可以提供帮助,因为来自
git daemon
的日志可以重定向到一个新的选项;一个相关的用例是从inetd
运行它时将日志发送到标准错误(而不是syslog)。
请参阅提交0c591ca (2018年2月4日) Lucas Werkmeister(
lucaswerkmeister
)。
帮助:ÆvarArnfjörðBjarmason(avar
), Junio C Hamano(gitster
)和 Eric Sunshine(sunshineco
)。
(由< a href =https://github.com/gitster =nofollow noreferrer> Junio C Hamano -gitster
- 在 $ b
守护进程 code>:add
- log-destination =(stderr | syslog | none)
选项可用于覆盖
$- inetd
的隐式- syslog
,或禁用所有日志记录。 (虽然- detach
也意味着- syslog
,- log-destination = stderr 与
- detach
是无用的,因为- detach
将进程与原始stderr分离。)- syslog
保留为- log-destination = syslog
的别名。
$ b
- log-destination
总是覆盖隐含的- syslog
,而不管
选项顺序。
这与
适用于Git其他地方的某些隐式选项的最后一个赢逻辑不同,但希望
不会让人困惑。
(我也不知道Git中的隐式选项是否跟随last one wins。)
- inetd
与- log-destination = stderr
的组合对于
实例是有用的,运行git daemon
作为实例systemd
service
(带有关联的套接字单元)。
在这个ca中se日志守护进程会收到通过syslog
发送的日志消息,但运行时有可能在git守护进程
过程已经退出(特别是如果过程非常短暂,例如由于客户端错误),以便日志守护程序不能再读取它的cgroup
和
将消息附加到正确的systemd
unit(请参阅 systemd / systemd issue 2913 )。记录到
stderr
可以解决此问题,因为systemd
可以连接stderr
直接写入日志守护进程,然后
知道哪个单元与这个流关联。
I am running git-daemon as a windows service. (using Create Process) The command used in service is : git daemon --reuseaddr --base-path=/data/test_work/ --export-all --verbose --enable=receive-pack
Where do I see the logs of git daemon?
Note: there is no file at /var/logs.
解决方案Where do I see the logs of git daemon?
Git 2.17 (Q1 2018) can help, since the log from "
git daemon
" can be redirected with a new option; one relevant use case is to send the log to standard error (instead of syslog) when running it frominetd
.See commit 0c591ca (04 Feb 2018) by Lucas Werkmeister (
lucaswerkmeister
).
Helped-by: Ævar Arnfjörð Bjarmason (avar
), Junio C Hamano (gitster
), and Eric Sunshine (sunshineco
).
(Merged by Junio C Hamano --gitster
-- in commit c2bd43d, 21 Feb 2018)
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 runninggit daemon
as an instancedsystemd
service (with associated socket unit).
In this case, log messages sent viasyslog
are received by the journal daemon, but run the risk of being processed at a time when thegit 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 itscgroup
and attach the message to the correctsystemd
unit (see systemd/systemd issue 2913). Logging tostderr
instead can solve this problem, becausesystemd
can connectstderr
directly to the journal daemon, which then already knows which unit is associated with this stream.
这篇关于git-daemon的日志保存在哪里? (在使用Cygwin的Windows上的Git)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!