How do i view / enable kernel logs on centos / red hat linux?

65,169

Solution 1

You can see the most recent lines of output from the kernel with the dmesg command.

Otherwise, you need to ensure that

  1. klogd is running (it's normally started with syslog, at boot time), and that
  2. syslogd is configured to log kernel messages to a file, perhaps with the following line from /etc/syslog.conf:

    kern.*<TAB><TAB><TAB>/var/log/kernel

make sure the file /var/log/kernel exists, and restart syslogd.

Solution 2

You're tuning a performance setting -- you really want to be looking at performance counters, not log messages. Presumably you're increasing the number of concurrent connections to improve the performance of some application; you should keep an eye on your app.

Share:
65,169

Related videos on Youtube

Chris
Author by

Chris

Updated on September 18, 2022

Comments

  • Chris
    Chris over 1 year

    Possible Duplicate:
    How do i view / enable kernel logs on an ec2 instance (amazon linux)?

    I've got a centos server that i'm playing around with TCP settings in the sysctl.conf to increase the number of concurrent TCP connections it can handle, and i want to be able to view the kernel log to see any errors in the TCP stack, to ensure i've configured everything correctly.

    I've read somewhere that i need to enable the kernel log first somehow, and then view the kernel log in /var/log/somewhere. Can anyone point me in the right direction? Thanks.

  • MadHatter
    MadHatter over 12 years
    You're right, my bad (fingers faster than brain). Fixed, and thank you!
  • Chris
    Chris over 12 years
    Turns out that on my distro it was rsyslog, might be worth mentioning.