In first place, ensure that you have configured the contact lookup, because chats will only be logged for matched contacts.
Second, chats are logged when the agent "deals with" the chat conversation from the web client. So ensure that you're selecting that option.