简体   繁体   English

如何防止将日志写入默认的 /var/log/messages 但仅写入自定义位置?

[英]How to prevent logs being written to the default /var/log/messages but only to the custom defined location?

Having already a defined custom rsyslog configuration like:已经定义了自定义 rsyslog 配置,例如:

:msg, regex, "myappname", /appl/logs/myappname.log

How can I prevent the logs being written both on /var/log/messages and /appl/logs/myappname.log?如何防止日志同时写入 /var/log/messages 和 /appl/logs/myappname.log?

Figured this out as I should just add:想通了这一点,因为我应该补充一下:

:msg, regex, "myappname" ~

as the 2nd line作为第二行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM