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.
You can see the most recent lines of output from the kernel with the
dmesg
command.Otherwise, you need to ensure that
klogd
is running (it's normally started with syslog, at boot time), and thatsyslogd
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.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.
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'!).
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?