Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

marked as duplicate by MadHatter, mailq, Iain, Shane Madden, Sam Sep 8 '11 at 21:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
serverfault.com/questions/308503/… –  quanta Sep 7 '11 at 11:15

3 Answers 3

up vote 4 down vote accepted

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.

share|improve this answer
    
Surely kern.* rather than kernel.* ? –  symcbean Sep 7 '11 at 12:45
    
You're right, my bad (fingers faster than brain). Fixed, and thank you! –  MadHatter Sep 7 '11 at 12:50
    
Turns out that on my distro it was rsyslog, might be worth mentioning. –  Chris Sep 14 '11 at 9:48

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|improve this answer

Unless you've switched it off, your system is already writing log files (the default config for both redhat and centos).

How you go about tinkering with the config depends on which distro of the OS is running - older ones use syslogd but more recently rsyslogd/syslog-ng are becoming more popular.

If it's a syslogd based config, then you should cat enable kernel logging in the conf file as described by MadHatter (but note that kernel messages are matched by 'kern' not 'kernel'!).

to see any errors in the TCP stack

Really? what exactly do you expect to see? Its a well written/well tuned bit of the kernel - it's unlikely to throw many errors even you specify a really bad config.

And is it a good idea to mess with the kernel options if you don't know how to do a relatively straightforward admin task?

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.