3

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

Chris
  • 1,261
  • 5
  • 15
  • 17
  • 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 06 '11 at 10:11
  • Amazon linux is based on centos / redhat AFAIK. – Chris Sep 06 '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 07 '11 at 10:32

1 Answers1

9

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.

quanta
  • 51,413
  • 19
  • 159
  • 217