Where are system level logs in aws linux

0

I'm running aws linux 2, when looking for /var/log/syslog no file found. Where can I find syslog file?

sedo
질문됨 일 년 전3021회 조회
1개 답변
2
수락된 답변

the following reference can work for you

https://www.syslog-ng.com/community/b/blog/posts/installing-syslog-ng-in-amazon-linux-2-including-graviton2

In Amazon Linux 2, which is a close relative of RHEL 7 / CentOS 7, system logs are managed by the syslog-ng service. To set it up, you need to install the syslog-ng package from the EPEL repository.

  • Enable the EPEL repository: amazon-linux-extras install epel
  • Install syslog-ng: yum install syslog-ng
  • Enable syslog-ng: systemctl enable syslog-ng
  • Start syslog-ng: systemctl start syslog-ng

To avoid confusion and duplicated log messages, you might also want to remove or at least stop and disable the rsyslog service: yum erase rsyslog After you've installed and started syslog-ng, you can check if it's working correctly by sending a test log message and checking if it appears in the /var/log/messages file. You can send a test message with the logger command: logger this is a test​.

profile picture
전문가
답변함 일 년 전
profile pictureAWS
전문가
iBehr
검토됨 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인