1 Answer
- Newest
- Most votes
- Most comments
2
the following reference can work for you
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.
Relevant content
- Accepted Answerasked 2 years ago
- Accepted Answerasked 4 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated a year ago