2 ways:
Dedicated host - this host will save all "chat logs" via localstorage forever. This particular client always has to be on, or at least end up hosting every game.
Third party database, like firebase, photon - Send and retrieve your "chat logs" to a third party server, where they can be accessible any time.