AttorneyOnline / tsuserver3

An Attorney Online server.
GNU Affero General Public License v3.0
25 stars 51 forks source link

Stop using SQLite for logging server events like IC and OOC #190

Open Crystalwarrior opened 3 years ago

Crystalwarrior commented 3 years ago

SQLite should only be used for handling bans, etc. Handling the area logs is only leading it to grow in size, and it's disgustingly easy to corrupt the database when trying to view the logs. It takes 30 seconds to run any given schema on especially large databases.

The solution is to bring back text logging for anything that's not benefiting from SQLite-specific features, such as bans.

also see https://github.com/Crystalwarrior/KFO-Server/issues/11, same issue since KFO is a fork of tsu3. Planning to attempt some solutions on my end at some point.

Crystalwarrior commented 3 years ago

Legacy branch's logger for KFO did the job: https://github.com/Crystalwarrior/KFO-Server/blob/legacy/old2018/server/logger.py

oldmud0 commented 3 years ago

working on it

Crystalwarrior commented 3 years ago

working on it

Oh yeah since you discontinued tsu3 wanna help kfo server :)

oldmud0 commented 3 years ago

Yeah I'm changing my changes to do a PR on kfo-server. It's a slightly different codebase.

I'm planning to support two different formats:

  1. Standard logging format that is easy to read.
    2021-08-20 22:50:02.055 [BAS] Lana (ipid: 4484, ooc_name: web44, showname: None) shouted: Hey you, what's up?
    2021-08-20 22:50:02.055 [BAS] Lana (ipid: 4484, ooc_name: web44, showname: None) said in OOC: ((case??))
    2021-08-20 22:50:02.055 [BAS] Lana (ipid: 4484, ooc_name: web44, showname: None) said: ((case??))
    2021-08-20 22:50:02.055 [BAS] Lana (ipid: 4484, ooc_name: web44, showname: None) disconnected from the server.
  2. Debug-friendly format that is extremely parseable and searchable (especially with tools like Splunk that are specialized for aggregating terabytes upon terabytes of log files), but still readable.
    2021-08-20 22:50:02.055 area=BAS ipid=4484 uid=32 cid=5 event=disconnect
    2021-08-20 22:50:02.055 area=BAS ipid=4484 uid=32 cid=5 event=chat char_name="Lana" ooc_name="web44" showname="" message="Yo what's up"
    2021-08-20 22:50:02.055 area=BAS ipid=4484 event=connect success=false

I don't think there is a substantial demand for the latter, so I might just keep that change specific to my server.

Crystalwarrior commented 2 years ago

working on it

any progress on this

oldmud0 commented 2 years ago

:headstone: