A Messages client can be configured to record its own conversations. The Messages server can also be configured to record all chat messages.
The client recording capability is useful to the individual Messages user, while the server message logging capability is intended for administrative and auditing purposes.
Transcripts are saved at /Library/Server/Messages/Data/message_archives.
Select Messages in the Server app sidebar.
Click “Archive all messages.”