Debug Logging iCal

One of the tools in the iCal -> iCal Server troubleshooting toolbelt is to debug log HTTP connections. You can capture packets for port 8008 using tcpdump. In the following command, we’ll capture the packets over interface en0 for tcp port 8008 to a file called iCal.pcap:

tcpdump -w iCal.pcap -i en0 tcp port 8008

We’ll then attempt to create a calendar entry in iCal or simply log into the server through iCal. CalDAV traffic will occur and then you can stop the tcpdump. In order to then read the tcpdump:

tcpdump -nnr iCal.pcap

Another option that can help to correlate traffic you see in the pcap from tcpdump is to enable debug logging of HTTP traffic in iCal. To do so, we’ll use the defaults command to write a TRUE value into the LogHTTPActivity key of the com.apple.iCal defaults domain:

defaults write com.apple.iCal LogHTTPActivity -boolean TRUE

Given the output of LogHTTPActivity and tcpdump to iCal.pcap you will in most cases triangulate the source of many of the problems that you encounter in iCal Server. Whether iCal cannot traverse to a given directory with CalDAV data, iCal cannot connect to the server or there is another form of connectivity issue, much of the troubleshooting will start with looking at the traffic over port 8008.

3 Comments

  • chad
    June 7, 2010 - 5:51 am | Permalink

    Nice to know about LogHTTPActivity!

    Reminds me a bit of sniffing on mail ports (regarding Apple’s Mail.app client program).

    http://codesnippets.joyent.com/posts/show/2292

    http://geekfoibles.wordpress.com/2009/04/21/overcoming-mailapps-lack-of-verbosity/

  • March 6, 2012 - 7:28 am | Permalink

    change debut to debug. Unless you really mean debut. I haven’t done it yet, so it would be my debut of this.

    • March 6, 2012 - 7:57 am | Permalink

      Thanks for the free editorial work!

  • Comments are closed.