Logging twitch chat for analysis?

I don’t know what Twitch’s legal/privacy policies say about users logging and saving information from Twitch, but what you want is probably doable.
Here’s some info on connecting, and rate limits (you can’t join all 100 channels at once, look at the rate limits and spread out your JOIN requests over time to avoid hitting the limits)
http://help.twitch.tv/customer/portal/articles/1302780-twitch-irc

There’s also a technical limitation with a server-side message queue, which Night explains here (more interesting discussion can be found in that thread about rate limits)