AlmaLinux 10 Log Analysis
This content is not available in your language yet.
logrotate and rsyslog packages
Section titled “logrotate and rsyslog packages”logrotate 3.22.0-5.el10 在 BaseOS(dnf list 实测);rsyslog 8.2510.0-5.el10_2.2 在 AppStream(实测)——两者是 EL10 日志管理的核心包。
journalctl key parameters
Section titled “journalctl key parameters”journalctl 关键参数:—since “1 hour ago”、—grep “关键词”(PCRE 正则)、-p err(优先级过滤)、-f(实时跟踪)、-u unit(按服务过滤)。容器内 journalctl 因无 systemd 不可用(如实记录)。
journald vs rsyslog relationship
Section titled “journald vs rsyslog relationship”journald 与 rsyslog 的分工:journald(systemd 标配,二进制索引日志,临时/持久取决于 Storage= 配置)→ rsyslog(可选安装,传统文本文件转发,写入 /var/log/messages 等)。EL10 默认两者并存。
logrotate configuration
Section titled “logrotate configuration”logrotate 配置:/etc/logrotate.conf 主配置 + /etc/logrotate.d/ 按服务切分。常用参数:daily/weekly、rotate N、compress、missingok、notifempty。文献口径。
Practical troubleshooting combinations
Section titled “Practical troubleshooting combinations”实战排查组合:journalctl -u nginx —since today(服务日志)→ journalctl -p err —since “-1h”(全系统错误)→ grep -r “error” /var/log/(文本日志兜底)→ ausearch -m avc(SELinux denial)。文献口径。
见各节标注「文献口径」的内容。