- database
I recommend the app integrated
Apache Derby DB[
^]
- text file
I recommend to use a logging solution like
Apache log4j[
^] to work on with/in style of log files. You can create a default error-log and add another config to save the chat-content in a seperated file. That would make sure that only a decent amount of chat entries are stored and deleted automatically when too old.