Mac OS X Server

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.