0

I am working on a Trash implementation and would like to store a log for every deletion. I have reviewed the Freedesktop Trash Specification but couldn't find any information about where to store a trash log. What would be the best and most logical place to store a trash log?

I have considered several options including:

  • Storing the log file in .local/share/Trash/info/trashlog.trashinfo, together with the other Trash Info files.
  • Creating a separate directory for the log file, such as .local/share/Trash/trashlog, to avoid cluttering the directory with other files.
  • Storing the log file in the top directory of .local/share/Trash, alongside the files and info directories.
  • Storing the log file in /var/log, where logs are usually stored.
  • Not storing a trash log at all, if it is considered unnecessary or pointless.

Please provide your recommendation on the most appropriate location for storing the trash log, and explain why that location is the best choice. Thank you.

0

1 Answer 1

0

For whom is the trash log intended? Is it for the user that does the deletions, or for the system administrator? If for the former, somewhere under the user's home directory would be the natural location, as the user may not have write access anywhere else. If for the latter, then /var/log.

In other words, this is the privacy of each individual user vs. possible requirements of system auditability; to cover all the bases, you may have to make it configurable.

1
  • Thank you. Ok, I make it configurable and include the option to choose the log path, through a configuration file, to cover all cases. I decided to choose .local/share/Trash/trashlog/trashlog as the default option. Commented Mar 16, 2023 at 8:07

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.