I've got a amazon ec2 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. Can anyone point me in the right direction? Thanks.

The AMI i'm using is: amzn-ami-2011.02.1.x86_64

link|improve this question

40% accept rate
I'm not familiar with Amazon EC2, so could you please post the output of cat /etc/issue to see which distro you are running. – quanta Sep 6 '11 at 10:11
Amazon linux is based on centos / redhat AFAIK. – Chris Sep 6 '11 at 23:17
@quanta - When i did a cat /etc/issue i got the following: [ec2-user@ip-10-112-97-251 ~]$ cat /etc/issue Amazon Linux AMI release 2011.02.1.1 (beta) Kernel \r on an \m – Chris Sep 7 '11 at 10:32
feedback

1 Answer

dmesg give you the kernel logs but it doesn't include the timestamp by default (it can be enable by recompiling kernel with CONFIG_PRINTK_TIME=y)

With [r]syslog, you can log all kernel messages to a file (with timestamp) by inserting a below line into /etc/[r]syslog.conf:

kern.*          /var/log/kern.log

Don't forget to restart [r]syslog daemon.

link|improve this answer
If i do ps -ef | grep log it shows that i'm running rsyslogd. – Chris Sep 14 '11 at 9:33
Is this how to restart rsyslog? sudo service rsyslog restart – Chris Sep 14 '11 at 9:47
OK. Or /etc/init.d/rsyslog restart. – quanta Sep 14 '11 at 9:49
feedback

Your Answer

 
or
required, but never shown

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