-
Notifications
You must be signed in to change notification settings - Fork 71
Description
Is your feature request related to a problem?
On those large Mincraft servers, the size of DB ledger.sqlite rapidly grows (about 1GB in just 3-5 days), even with objectBlacklist.
Perhaps they could set autoPurgeDays = xxx in the config file to limit the number of days the logs are stored, thus to limit the size of DB. But that's not good enough: What can I do when they need to look up logs from several months or even years ago?
I think a better solution would be to support logs import & export, so admins can effectively control the size of ledger.sqlite by periodically exporting and purging the old logs, without losing any of the past records.
Describe the solution you'd like.
-
Adds the
ledger exportcommand, which supports selectors similar to those used ininspectto select a range of logs to export. The export format can be.sqliteor.sqlor.csv. -
Add
ledger importcommand to import previously exported log data back.
Describe alternatives you've considered.
Add API to support importing search results in LedgerApi, so we can develop an extension to realize this feature instead.
Agreements
- I have searched for and ensured there isn't already an open issue regarding this.
- I have ensured the feature I'm requesting isn't already in the latest supported mod version.
Other
It is not feasible to operate the database of a running ledger mod directly using an external SQLite CLI. After testing, when using an external SQLite CLI to export data and execute VACUUM, it will conflict with the running ledger mod, causing the database into some problems or even corruption.
Therefore, Ledger's own Export function is still very necessary to implement.