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
gefragt vor einem Jahr3021 Aufrufe
1 Antwort
2
Akzeptierte Antwort

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
EXPERTE
beantwortet vor einem Jahr
profile pictureAWS
EXPERTE
iBehr
überprüft vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen