I use ethereal - you can output the data into several formats. The docs are a bit complicated since it's a powerful tool, but it's worth checking out. The tethereal utility that comes with it is for capturing and printing to stdout or a file. The ethereal utility is a gui to see things as they happen.
There's more to it than that, but my usage of it is at a basic level. For example, set some filters (port, host, protocol), capture data and dump it to disk. You can download it from
http://www.ethereal.com/.