如何将systemd服务的输出重定向到SyslogIdentifier

问题描述 投票:0回答:1

我可以将服务日志发送到文件引用-Redirect the output of systemd service to a file

但是如何将systemd服务的输出重定向到syslogIdentifier

ubuntu service systemd syslog
1个回答
0
投票

SyslogIdentifier可用于弹性拍子中以获取实时日志和许多其他情况。

主要是我的用例是从所有产品,开发人员和测试环境中获取弹性搜索中的实时日志。

您只需要添加一行-

[Unit]
. 
. 

[Service]
.
.
SyslogIdentifier = <YourAppName>
.
.

[Install]
.
.
© www.soinside.com 2019 - 2024. All rights reserved.