Indeed compliance is an issue with IRC, but you don't need to write an IRCd to log all messages and you don't even need to configure IRC services: you could just use InspIRCd [1] (which, by the way, is a superb and extensible IRCd) and an extension such as [2] to achieve what you are looking for.
[1] https://www.inspircd.org/ [2] https://github.com/joshenders/inspircd-m_chatlog