【问题标题】:How to make systemd message not show in /var/log/message如何使 systemd 消息不显示在 /var/log/message 中
【发布时间】:2017-11-12 16:06:13
【问题描述】:

systemd中自定义应用如何自定义日志路径,默认为/var/log/message

【问题讨论】:

    标签: centos7 systemd


    【解决方案1】:

    我已经通过使用解决了这个问题

    ExecStart=/bin/sh -c '/apppath/appname > /filepath/filename 2>&1'
    

    https://www.freedesktop.org/software/systemd/man/systemd.service.html

    【讨论】:

    • ``` [Unit] Description=app After=network.target [Service] WorkingDirectory=/apppath ExecStart=/apppath/appname StandardOutput=syslog SyslogFacility=local6 StandardError=syslog Restart=always RestartSec=20 [安装] WantedBy=multi-user.target ``` ``` local6.info /var/log/app.log ``
    猜你喜欢
    • 2016-02-29
    • 2015-08-25
    • 2023-04-02
    • 1970-01-01
    • 2021-09-09
    • 2021-03-11
    • 1970-01-01
    • 1970-01-01
    • 2019-11-26
    相关资源
    最近更新 更多