Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一项服务可以将不必要的消息记录到日志中。这可以完全关闭吗?
我试图用属于该服务的 log4j.properties 来完成它,但这对汉斯没有帮助
StandardOutput并且StandardError默认连接到日志。但是您可以在您的[Service]部分中自定义它并将两者都重定向到/dev/null:
StandardOutput
StandardError
[Service]
/dev/null
[Service] ... StandardOutput=null StandardError=null