Zone Server automatically send chat logs to the logger if logging is enabled. So write a custom logger which parses the chat logs sent by Zone Server and inserts into database.
I think karthikreads' reply is enough for your need.
All you need to do is, do as he said..
What he is trying to say is,
The zoneserver is coded to send chat logs to log file. i.e. the files which stores chat after its tapped.
All You have to do is, Make a customer logger, which enables tapping Chat of player, as soon as he is logged in..