I’ve been scouring documentation and been through a few emulation sites looking for a proper answer to this. But is there any way I can log chat into the databases?
I’ve tried playing with loggers and appenders but I can’t seem to get it working. I’m just looking to log all chat data from my players into the database.
I know that example is just for GM logging, but it probably applies to chat as well.
Probably a good idea to first get chat to log into a file.
And only then look into getting it in to DB.
I am not sure how much it’s changed from a couple of years ago when I looked at it, but chat was handled server<->client side and wasn’t recorded anywhere. I believe in order to log it to either file or database you would need to modify core to first log it, as I think right now it just relays to the needed clients when the server receives it.
It should be loggable like many other things. Have you looked at the loggers in worldserver.conf? Search for chat.
According to commit history it has been loggable a long time. For example this commit from 6 years back seems to show that chat logging existed even back then and before it https://github.com/TrinityCore/TrinityCore/commit/97c4b92eb02fc673d1230aadaee23aa7827a9761
I have looked at the loggers and appenders in the worldserver.conf but I can’t seem to get them to work, following the TC documentation and from looking through the net. It’s all tutorials and docs about how to log it to a file, not a database.
I can’t see that it wouldn’t be possible, just doesn’t seem to be something that more people want.
It seems definitely possible, I’m just trying to figure out how exactly.
The chat log log can easily log to the DB, Iv’e done it before with config changes. You have to enable the chat log as “debug” so it traps everything. Then set the Console to log to DB as well. It dumps to the Auth DB.
I am logging to mysql with a custom script that uses OnChat, only for the normal system CHANNEL_FLAG_* channels.
I have cheesy perl scripts that read the messages and parse them, such as looking for "WTB" links and then the script may put an item in the AH and another that responds to LFG with calendar messages "LFG URBS" and the script looks up the calendar saying "URBS planned for 18:30 GMT 8/10 confirmed, PST for invite" (minus timezone / calendar glitches which I cannot figure out)
I agree that the table size gets crazy fast if you retain world chat, some partitioning is needed.
This can probably be moved to Custom Code section - However, I actually was able to implement “in core” to log all chat to the database in a separate table under “characters”. Let me know if you or anyone is interested, I can share the patch in github.