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
asked a year ago2899 views
1 Answer
2
Accepted Answer

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
EXPERT
answered a year ago
profile pictureAWS
EXPERT
iBehr
reviewed 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions