logstash - 如何在 syslog 中禁用 logstash 错误日志记录
问题描述
所有 Logstash 错误都记录在 /var/log/logstash/* 中,但 Logstash 的所有错误日志也记录在 /var/log/syslog 中。有什么方法可以在 /var/log/syslog 中禁用 Logstash 的日志记录错误?
解决方案
另一种解决方案是修改/etc/systemd/system/logstash.service
和更改这两个选项,如下所示
StandardOutput=null
StandardError=null
# cat /etc/systemd/system/logstash.service
[Unit]
Description=logstash
[Service]
Type=simple
User=logstash
Group=logstash
# Load env vars from /etc/default/ and /etc/sysconfig/ if they exist.
# Prefixing the path with '-' makes it try to load, but if the file doesn't
# exist, it continues onward.
EnvironmentFile=-/etc/default/logstash
EnvironmentFile=-/etc/sysconfig/logstash
ExecStart=/usr/share/logstash/bin/logstash "--path.settings" "/etc/logstash"
StandardOutput=null
StandardError=null
Restart=always
WorkingDirectory=/
Nice=19
LimitNOFILE=16384
# When stopping, how long to wait before giving up and sending SIGKILL?
# Keep in mind that SIGKILL on a process can cause data loss.
TimeoutStopSec=infinity
[Install]
WantedBy=multi-user.target
那么当然
#systemctl daemon-reload
#systemctl restart logstash
推荐阅读
- logging - Undertow java.util.logging:如何使用 java util logging 在运行时更改 undertow 服务器的日志记录级别
- node.js - ionViewWillEnter 在进入页面时不起作用
- c# - 如何将动态生成的列与键值对进行数据绑定?
- r - 奇怪的 igraph 行为,生成重复的顶点
- apache-kafka - 当我们使用 kafka 流时,kafka serde 配置应该是什么
- html - h1 大小在 Div 标签和 section 标签中不同
- delphi - 是否可以显示带有粗体和普通字体的格式化消息?
- r - R - 创建检查多个数据帧中的 NA 的数据帧
- node.js - 使用节点获取特定 Postgres 数据库中的所有表?
- jenkins - Jenkins groovy 全局库声明性管道错误