Works/CentOS & RockyLinux
[Centos7] /var/log/message Info성 systemd: ~ 메시지들 미출력되도록 설정하는 방법
Antamis
2023. 4. 11. 09:38
아래와 같은 시스템로그가 계속 발생하는 것은 문제 없는, Info성 메시지이다. 하지만 이 부분이 거슬릴 경우 해당 메시지가 쌓이지 않도록 설정할 수 있다.
1. 아래 커맨드 입력을 통해 해당 로그가 쌓이지 않도록 설정해주자.
echo 'if $programname == "systemd" and ($msg contains "Starting Session" or $msg contains "Started Session" or $msg contains "Created slice" or $msg contains "Starting user-" or $msg contains "Starting User Slice of" or $msg contains "Removed session" or $msg contains "Removed slice User Slice of" or $msg contains "Stopping User Slice of") then stop' >> /etc/rsyslog.d/ignore-systemd-session-slice.conf
( 한줄이다. )
2. 설정파일 적용을 위해 rsyslog 재시작을 해주자.
systemctl restart rsyslog